diff --git a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py index c9d2e939095d9311ad9a58c6e49e39510ad6b4e5..381b31cf04f6cc1c396eebe65507b11f7ed673c9 100755 --- a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py +++ b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py @@ -630,12 +630,11 @@ class OpSet9(): layer_attrs["pad"] = paddings paddle_op = "custom_layer:PadAllDim4WithOneInput" else: - pad_data = pads - pad_data1 = pad_data[0::2] + pad_data_temp = pads[0::2] pad_data_all = [] - for i in range(len(pad_data1)): - pad_data_all.append(pad_data[i]) - pad_data_all.append(pad_data[len(pad_data1) + i]) + for i in range(len(pad_data_temp)): + pad_data_all.append(pads[i]) + pad_data_all.append(pads[len(pad_data_temp) + i]) layer_attrs["pad"] = pad_data_all self.paddle_graph.add_layer(