Skip to content

Commit

Permalink
[TOSA] Add reflection_pad3d lowering (#3933)
Browse files Browse the repository at this point in the history
- Add Torch to TOSA legalization for `aten.replication_pad3d`
- Add new e2e tests and update xfail sets
- Add new LIT test to basic.mlir
  • Loading branch information
sahas3 authored Jan 7, 2025
1 parent 356540a commit bf594b0
Show file tree
Hide file tree
Showing 9 changed files with 501 additions and 257 deletions.
24 changes: 24 additions & 0 deletions include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -9997,6 +9997,30 @@ def Torch_AtenReflectionPad2dOp : Torch_Op<"aten.reflection_pad2d", [
}];
}

def Torch_AtenReflectionPad3dOp : Torch_Op<"aten.reflection_pad3d", [
AllowsTypeRefinement,
HasValueSemantics,
ReadOnly
]> {
let summary = "Generated op for `aten::reflection_pad3d : (Tensor, int[]) -> (Tensor)`";
let arguments = (ins
AnyTorchTensorType:$self,
AnyTorchListOfTorchIntType:$padding
);
let results = (outs
AnyTorchOptionalTensorType:$result
);
let hasCustomAssemblyFormat = 1;
let extraClassDefinition = [{
ParseResult AtenReflectionPad3dOp::parse(OpAsmParser &parser, OperationState &result) {
return parseDefaultTorchOp(parser, result, 2, 1);
}
void AtenReflectionPad3dOp::print(OpAsmPrinter &printer) {
printDefaultTorchOp(printer, *this, 2, 1);
}
}];
}

def Torch_AtenPadOp : Torch_Op<"aten.pad", [
AllowsTypeRefinement,
HasValueSemantics,
Expand Down
Loading

0 comments on commit bf594b0

Please sign in to comment.