From 4309c3169591025e62066965779e0f7504b5cfda Mon Sep 17 00:00:00 2001 From: wjj19950828 Date: Tue, 10 May 2022 16:00:14 +0800 Subject: [PATCH] Support onnx roberta --- x2paddle/op_mapper/onnx2paddle/opset9/opset.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py index 05acacd..6cd7317 100755 --- a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py +++ b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py @@ -457,6 +457,18 @@ class OpSet9(): outputs=[node.name], **attrs) + @print_mapping_info + def CumSum(self, node): + val_x = self.graph.get_input_node(node, idx=0, copy=True) + axis = self.graph.get_input_node(node, idx=1, copy=True) + axis_values = _const_weight_or_none(axis) + layer_attrs = {'axis': axis_values} + self.paddle_graph.add_layer( + 'paddle.cumsum', + inputs={"x": val_x.name}, + outputs=[node.name], + **layer_attrs) + @print_mapping_info def HardSigmoid(self, node): val_x = self.graph.get_input_node(node, idx=0, copy=True) -- GitLab