提交 7e114f52 编写于 作者: S SunAhong1993

fix

上级 9bcbe21c
......@@ -676,8 +676,8 @@ class TFOpMapper(OpMapper):
input = self.graph.get_input_node(node, 0)
paddings = self.graph.get_input_node(node, 1)
assert paddings.layer_type == "Const", "Padding should be Const"
paddings = numpy.flip(paddings.value, 0).flatten().tolist()
dim = int(len(paddings) / 2)
new_paddings = numpy.flip(paddings.value, 0).flatten().tolist()
dim = int(len(new_paddings) / 2)
transpose_name = gen_name("pad", "transpose")
self.paddle_graph.add_layer(
kernel="paddle.transpose",
......@@ -688,7 +688,7 @@ class TFOpMapper(OpMapper):
kernel="paddle.nn.Pad{}D".format(dim),
inputs={"x": transpose_name},
outputs=layer_outputs,
pad=new_padding)
pad=new_paddings)
self.paddle_graph.add_layer(
kernel="paddle.transpose",
inputs={"x": node.name},
......
......@@ -661,7 +661,7 @@ class TFOpMapper(OpMapper):
input = self.graph.get_input_node(node, 0)
paddings = self.graph.get_input_node(node, 1)
assert paddings.layer_type == "Const", "Padding should be Const"
paddings = numpy.flip(paddings.value, 0).flatten().tolist()
new_paddings = numpy.flip(paddings.value, 0).flatten().tolist()
transpose_name = gen_name("pad", "transpose")
self.paddle_graph.add_layer(
kernel="paddle.transpose",
......@@ -672,7 +672,7 @@ class TFOpMapper(OpMapper):
kernel="paddle.nn.functional.pad".format(dim),
inputs={"x": transpose_name},
outputs=[node.name],
pad=new_padding)
pad=new_paddings)
self.paddle_graph.add_layer(
kernel="paddle.transpose",
inputs={"x": node.name},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册