From 9c704135fa877e5155df980591d2b48cc7605115 Mon Sep 17 00:00:00 2001 From: Yan Xu Date: Tue, 21 Jun 2022 08:49:45 +0000 Subject: [PATCH] add relu6 op --- .../Dialect/Torch/IR/GeneratedTorchOps.td | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td b/include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td index e2f2b5061e12..ba0062286456 100644 --- a/include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td +++ b/include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td @@ -158,6 +158,54 @@ def Torch_AtenRelu_Op : Torch_Op<"aten.relu_", [ }]; } + +def Torch_AtenRelu6Op : Torch_Op<"aten.relu6", [ + AllowsTypeRefinement, + HasValueSemantics, + ReadOnly + ]> { + let summary = "Generated op for `aten::relu6 : (Tensor) -> (Tensor)`"; + let arguments = (ins + AnyTorchTensorType:$self + ); + let results = (outs + AnyTorchTensorType:$result + ); + let hasCustomAssemblyFormat = 1; + let extraClassDefinition = [{ + ParseResult AtenRelu6Op::parse(OpAsmParser &parser, OperationState &result) { + return parseDefaultTorchOp(parser, result, 1, 1); + } + void AtenRelu6Op::print(OpAsmPrinter &printer) { + printDefaultTorchOp(printer, *this, 1, 1); + } + }]; +} + +def Torch_AtenRelu6_Op : Torch_Op<"aten.relu6_", [ + AllowsTypeRefinement, + HasValueSemantics, + ReadOnly + ]> { + let summary = "Generated op for `aten::relu6_ : (Tensor) -> (Tensor)`"; + let arguments = (ins + AnyTorchTensorType:$self + ); + let results = (outs + AnyTorchTensorType:$result + ); + let hasCustomAssemblyFormat = 1; + let extraClassDefinition = [{ + ParseResult AtenRelu6_Op::parse(OpAsmParser &parser, OperationState &result) { + return parseDefaultTorchOp(parser, result, 1, 1); + } + void AtenRelu6_Op::print(OpAsmPrinter &printer) { + printDefaultTorchOp(printer, *this, 1, 1); + } + }]; +} + + def Torch_AtenLeakyReluOp : Torch_Op<"aten.leaky_relu", [ AllowsTypeRefinement, HasValueSemantics,