From 942de104ed481e2bc64b0aabe0b4ed538ce9da54 Mon Sep 17 00:00:00 2001 From: wjj19950828 Date: Wed, 11 May 2022 15:02:56 +0800 Subject: [PATCH] deal with comments --- x2paddle/op_mapper/onnx2paddle/opset9/opset.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py index 61c2124..a4b3a15 100755 --- a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py +++ b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py @@ -741,7 +741,6 @@ class OpSet9(): axes = node.get_attr('axes') if axes is None: axes = self.graph.get_input_node(node, idx=1, copy=True) - axes = _const_weight_or_none(axes) if len(val_x.out_shapes[0]) == 0 and len(axes) == 1 and axes[0] == 0: if node.name: self.paddle_graph.add_layer( @@ -1711,8 +1710,7 @@ class OpSet9(): x_shape = val_x.out_shapes[0] y_shape = val_y.out_shapes[0] inputs_dict = {"x": val_x.name, "y": val_y.name} - if len(y_shape) != 0 and y_shape[0] == 1 and len( - x_shape) != 0 and x_shape[-1] != 1 and x_shape[0] != 1: + if y_shape[0] == 1 and x_shape[-1] != 1 and x_shape[0] != 1: y_squeeze = val_y.name + '_squeeze' self.paddle_graph.add_layer( "paddle.squeeze", -- GitLab