Skip to content

Commit

Permalink
[ONNX][MLIR] Add support for onnx.Exp op
Browse files Browse the repository at this point in the history
  • Loading branch information
AmosLewis committed Jan 23, 2024
1 parent dc056e5 commit b696262
Show file tree
Hide file tree
Showing 2 changed files with 239 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Conversion/TorchOnnxToTorch/DefaultDomainAtoF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,17 @@ void mlir::torch::onnx_c::populateDefaultDomainAtoF(
binder.op, resultType, operand);
return success();
});
patterns.onOp("Exp", 6,
[](OpBinder binder, ConversionPatternRewriter &rewriter) {
Torch::ValueTensorType resultType;
Value operand;
if (binder.tensorOperand(operand) ||
binder.tensorResultType(resultType))
return failure();
rewriter.replaceOpWithNewOp<Torch::AtenExpOp>(
binder.op, resultType, operand);
return success();
});
patterns.onOp(
"Expand", 1, [](OpBinder binder, ConversionPatternRewriter &rewriter) {
// uses ideas and code from onnx.Reshape
Expand Down
Loading

0 comments on commit b696262

Please sign in to comment.