Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
Signed-off-by: Hengyu Meng <[email protected]>
  • Loading branch information
airMeng committed Sep 29, 2022
1 parent 8907255 commit fa6c140
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/Conversion/ONNXToKrnl/Tensor/ArgMinMax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ inline Value getCondition<ONNXArgMaxOp>(
}

template <typename ArgOp>
inline DimsExpr getOutputDims(ArgOp *op,
typename ArgOp::Adaptor operandAdaptor, mlir::OpBuilder *rewriter,
ArrayValueIndexCapture::GetDenseVal fGetDenseVal,
inline DimsExpr getOutputDims(ArgOp *op, typename ArgOp::Adaptor operandAdaptor,
mlir::OpBuilder *rewriter, ArrayValueIndexCapture::GetDenseVal fGetDenseVal,
ArrayValueIndexCapture::LoadVal fLoadVal);

template <>
inline DimsExpr getOutputDims<ONNXArgMinOp>(
ONNXArgMinOp *op, typename ONNXArgMinOp::Adaptor operandAdaptor,
mlir::OpBuilder *rewriter, ArrayValueIndexCapture::GetDenseVal fGetDenseVal,
inline DimsExpr getOutputDims<ONNXArgMinOp>(ONNXArgMinOp *op,
typename ONNXArgMinOp::Adaptor operandAdaptor, mlir::OpBuilder *rewriter,
ArrayValueIndexCapture::GetDenseVal fGetDenseVal,
ArrayValueIndexCapture::LoadVal fLoadVal) {
ONNXArgMinOpShapeHelper shapeHelper(op, rewriter, fGetDenseVal, fLoadVal);
auto shapecomputed = shapeHelper.computeShape(operandAdaptor);
Expand All @@ -57,9 +56,9 @@ inline DimsExpr getOutputDims<ONNXArgMinOp>(
}

template <>
inline DimsExpr getOutputDims<ONNXArgMaxOp>(
ONNXArgMaxOp *op, typename ONNXArgMaxOp::Adaptor operandAdaptor,
mlir::OpBuilder *rewriter, ArrayValueIndexCapture::GetDenseVal fGetDenseVal,
inline DimsExpr getOutputDims<ONNXArgMaxOp>(ONNXArgMaxOp *op,
typename ONNXArgMaxOp::Adaptor operandAdaptor, mlir::OpBuilder *rewriter,
ArrayValueIndexCapture::GetDenseVal fGetDenseVal,
ArrayValueIndexCapture::LoadVal fLoadVal) {
ONNXArgMaxOpShapeHelper shapeHelper(op, rewriter, fGetDenseVal, fLoadVal);
auto shapecomputed = shapeHelper.computeShape(operandAdaptor);
Expand All @@ -81,8 +80,8 @@ struct ONNXArgMinMaxOpLowering : public ConversionPattern {
ArgOp argOp = llvm::cast<ArgOp>(op);

typename ArgOp::Adaptor operandAdaptor(operands);
DimsExpr OutputDims = getOutputDims<ArgOp>(&argOp, operandAdaptor, &rewriter,
krnl::getDenseElementAttributeFromKrnlValue,
DimsExpr OutputDims = getOutputDims<ArgOp>(&argOp, operandAdaptor,
&rewriter, krnl::getDenseElementAttributeFromKrnlValue,
krnl::loadDenseElementArrayValueAtIndex);

// Convert the reduced output type to MemRefType.
Expand Down

0 comments on commit fa6c140

Please sign in to comment.