diff --git a/x2paddle/op_mapper/pytorch2paddle/aten.py b/x2paddle/op_mapper/pytorch2paddle/aten.py index 17798f5737fdfa59f94c295c238fe29d90c0db41..b5f25ad65a17a7f80f0f95d43912e888408b2a06 100644 --- a/x2paddle/op_mapper/pytorch2paddle/aten.py +++ b/x2paddle/op_mapper/pytorch2paddle/aten.py @@ -423,7 +423,7 @@ def aten_avg_pool2d(mapper, graph, node): graph.add_layer( "prim.assert", inputs={}, - outputs=[inputs_name[6]], + outputs=[inputs_name[6] + "_assert"], type="eq", key=mapper.attrs[inputs_name[6]], value=None) @@ -1473,7 +1473,7 @@ def aten_flatten(mapper, graph, node): graph.add_layer( "prim.assert", inputs={}, - outputs=[inputs_name[1]], + outputs=[inputs_name[1] + "_assert"], type='eq', key=mapper.attrs[inputs_name[1]], value=1) @@ -1481,7 +1481,7 @@ def aten_flatten(mapper, graph, node): graph.add_layer( "prim.assert", inputs={}, - outputs=[inputs_name[2]], + outputs=[inputs_name[2] + "_assert"], type='eq', key=mapper.attrs[inputs_name[2]], value=-1) @@ -2378,7 +2378,7 @@ def aten_max_pool2d(mapper, graph, node): graph.add_layer( "prim.assert", inputs={}, - outputs=[inputs_name[4]], + outputs=[inputs_name[4] + "_assert"], type="eq", key=mapper.attrs[inputs_name[4]], value=[1, [1, 1]]) @@ -3912,7 +3912,7 @@ def aten_upsample_bilinear2d(mapper, graph, node): type="eq") layer_inputs["scale_factor"] = inputs_name[3] layer_attrs["align_mode"] = 0 - layer_attrs["mode"] = "bilinear" + layer_attrs["mode"] = string("bilinear") graph.add_layer( "paddle.nn.functional.interpolate", inputs=layer_inputs, diff --git a/x2paddle/optimizer/pytorch_optimizer/__init__.py b/x2paddle/optimizer/pytorch_optimizer/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391