From 981bdfaaf5655299c35ffb89925a59bc4b686c08 Mon Sep 17 00:00:00 2001 From: channingss Date: Sat, 19 Sep 2020 11:14:49 +0800 Subject: [PATCH] fix the bug --- x2paddle/op_mapper/pytorch2paddle/aten.py | 10 +++++----- x2paddle/optimizer/pytorch_optimizer/__init__.py | 0 2 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 x2paddle/optimizer/pytorch_optimizer/__init__.py diff --git a/x2paddle/op_mapper/pytorch2paddle/aten.py b/x2paddle/op_mapper/pytorch2paddle/aten.py index 17798f5..b5f25ad 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 0000000..e69de29 -- GitLab