Skip to content

Commit 77ae563

Browse files
authored
[ONNX][MLIR] Add support for onnx.Exp op (#2792)
nod-ai/AMD-SHARK-ModelDev#312
1 parent dc056e5 commit 77ae563

File tree

2 files changed

+239
-0
lines changed

2 files changed

+239
-0
lines changed

lib/Conversion/TorchOnnxToTorch/DefaultDomainAtoF.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,17 @@ void mlir::torch::onnx_c::populateDefaultDomainAtoF(
13321332
binder.op, resultType, operand);
13331333
return success();
13341334
});
1335+
patterns.onOp("Exp", 6,
1336+
[](OpBinder binder, ConversionPatternRewriter &rewriter) {
1337+
Torch::ValueTensorType resultType;
1338+
Value operand;
1339+
if (binder.tensorOperand(operand) ||
1340+
binder.tensorResultType(resultType))
1341+
return failure();
1342+
rewriter.replaceOpWithNewOp<Torch::AtenExpOp>(
1343+
binder.op, resultType, operand);
1344+
return success();
1345+
});
13351346
patterns.onOp(
13361347
"Expand", 1, [](OpBinder binder, ConversionPatternRewriter &rewriter) {
13371348
// uses ideas and code from onnx.Reshape

0 commit comments

Comments
 (0)