提交 9bcbe21c 编写于 作者: S SunAhong1993

fix the tf

上级 6d86e8ea
...@@ -361,6 +361,8 @@ class TFDecoder(object): ...@@ -361,6 +361,8 @@ class TFDecoder(object):
continue continue
graph_node = TFGraphNode(layer) graph_node = TFGraphNode(layer)
dtype = graph_node.layer.attr['dtype'].type dtype = graph_node.layer.attr['dtype'].type
if dtype == 10:
continue
need_define_shape = 0 need_define_shape = 0
if self.define_input_shape: if self.define_input_shape:
......
...@@ -676,7 +676,7 @@ class TFOpMapper(OpMapper): ...@@ -676,7 +676,7 @@ class TFOpMapper(OpMapper):
input = self.graph.get_input_node(node, 0) input = self.graph.get_input_node(node, 0)
paddings = self.graph.get_input_node(node, 1) paddings = self.graph.get_input_node(node, 1)
assert paddings.layer_type == "Const", "Padding should be Const" assert paddings.layer_type == "Const", "Padding should be Const"
paddings = np.flip(paddings.value, 0).flatten().tolist() paddings = numpy.flip(paddings.value, 0).flatten().tolist()
dim = int(len(paddings) / 2) dim = int(len(paddings) / 2)
transpose_name = gen_name("pad", "transpose") transpose_name = gen_name("pad", "transpose")
self.paddle_graph.add_layer( self.paddle_graph.add_layer(
......
...@@ -661,7 +661,7 @@ class TFOpMapper(OpMapper): ...@@ -661,7 +661,7 @@ class TFOpMapper(OpMapper):
input = self.graph.get_input_node(node, 0) input = self.graph.get_input_node(node, 0)
paddings = self.graph.get_input_node(node, 1) paddings = self.graph.get_input_node(node, 1)
assert paddings.layer_type == "Const", "Padding should be Const" assert paddings.layer_type == "Const", "Padding should be Const"
paddings = np.flip(paddings.value, 0).flatten().tolist() paddings = numpy.flip(paddings.value, 0).flatten().tolist()
transpose_name = gen_name("pad", "transpose") transpose_name = gen_name("pad", "transpose")
self.paddle_graph.add_layer( self.paddle_graph.add_layer(
kernel="paddle.transpose", kernel="paddle.transpose",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册