mirror of https://github.com/llvm/torch-mlir
[ONNX] Handle one-input case for Min ONNX operator (#3326)
This commit handles the one-input case for the "Min" ONNX operator. A new unit test has also been added.pull/3328/head
parent
be20db0a0e
commit
261074f594
|
@ -667,7 +667,7 @@ void mlir::torch::onnx_c::populateDefaultDomainGtoP(
|
|||
result = rewriter.create<Torch::AtenMinimumOp>(
|
||||
binder.getLoc(), resultType, result, operands[i]);
|
||||
}
|
||||
rewriter.replaceOp(binder.op, result.getDefiningOp());
|
||||
rewriter.replaceOp(binder.op, result);
|
||||
return success();
|
||||
});
|
||||
patterns.onOp("Neg", 1,
|
||||
|
|
|
@ -758,6 +758,15 @@ func.func @test_globalaveragepool_precomputed(%arg0: !torch.vtensor<[1,1,3,3],f3
|
|||
|
||||
// -----
|
||||
|
||||
// CHECK-LABEL: func.func @test_min_one_input_example
|
||||
func.func @test_min_one_input_example(%arg0: !torch.vtensor<[3],f32>) -> !torch.vtensor<[3],f32> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 13 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
|
||||
// CHECK: return %arg0 : !torch.vtensor<[3],f32>
|
||||
%0 = torch.operator "onnx.Min"(%arg0) : (!torch.vtensor<[3],f32>) -> !torch.vtensor<[3],f32>
|
||||
return %0 : !torch.vtensor<[3],f32>
|
||||
}
|
||||
|
||||
// -----
|
||||
|
||||
// CHECK-LABEL: func.func @test_mod_int64_fmod
|
||||
func.func @test_mod_int64_fmod(%arg0: !torch.vtensor<[6],si64>, %arg1: !torch.vtensor<[6],si64>) -> !torch.vtensor<[6],si64> attributes {torch.onnx_meta.ir_version = 7 : si64, torch.onnx_meta.opset_version = 13 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
|
||||
// CHECK: torch.aten.fmod.Tensor %arg0, %arg1 : !torch.vtensor<[6],si64>, !torch.vtensor<[6],si64> -> !torch.vtensor<[6],si64>
|
||||
|
|
Loading…
Reference in New Issue