diff --git a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py index 084b3f89705b469bf4874a65bd3df693512138b9..e2d0e10429a8e974f96e893a4b23bbe555a41840 100755 --- a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py +++ b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py @@ -911,6 +911,13 @@ class OpSet9(): 'index': indices.name}, outputs=[node.name], axis=axis) + # deal with indice is scalar(0D) Tensor + if isinstance(indices_values, int) and len(val_x_shape) > 1: + self.paddle_graph.add_layer( + 'paddle.squeeze', + inputs={'x': node.name}, + outputs=[node.name], + axis=[axis]) else: # if val_x is DataNode, convert gather to embedding if axis == 0 and isinstance(val_x, ONNXGraphDataNode):