From e95a1f9d78863c2be304cd7389020ac0bbcf674a Mon Sep 17 00:00:00 2001 From: Channingss Date: Mon, 3 Aug 2020 11:51:11 +0000 Subject: [PATCH] support abs,instance_norm --- x2paddle/op_mapper/paddle2onnx/opset9/opset.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/x2paddle/op_mapper/paddle2onnx/opset9/opset.py b/x2paddle/op_mapper/paddle2onnx/opset9/opset.py index 06e12f0..8cc238f 100644 --- a/x2paddle/op_mapper/paddle2onnx/opset9/opset.py +++ b/x2paddle/op_mapper/paddle2onnx/opset9/opset.py @@ -141,6 +141,11 @@ class OpSet9(object): 'Exp', inputs=op.input('X'), outputs=op.output('Out')) return node + def abs(self, op, block): + node = helper.make_node( + 'Abs', inputs=op.input('X'), outputs=op.output('Out')) + return node + def leaky_relu(self, op, block): node = helper.make_node( 'LeakyRelu', @@ -375,6 +380,16 @@ class OpSet9(object): **kwargs) return node + def instance_norm(self, op, block): + kwargs = {'epsilon': op.attr('epsilon'), } + inputs = op.input('X') + op.input('Scale') + op.input('Bias') + node = helper.make_node( + 'InstanceNormalization', + inputs=inputs, + outputs=op.output('Y'), + **kwargs) + return node + def concat(self, op, block): node = helper.make_node( 'Concat', -- GitLab