提交 90a29f43 编写于 作者: S SunAhong1993

add ReverseV2

上级 6735bf9d
......@@ -1526,3 +1526,21 @@ class TFOpMapper(OpMapper):
inputs=inputs,
outputs=[node.name],
**attr)
def ReverseV2(self, node):
x = self.graph.get_input_node(node, 0)
axis = self.graph.get_input_node(node, 1)
inputs = {"x": x.name}
attr = dict()
if axis.layer_type == 'Const':
axis = axis.value.tolist()
if not isinstance(axis, list):
axis = [axis]
attr['axis'] = axis
else:
inputs['axis'] = axis.name
self.paddle_graph.add_layer(
"paddle.flip",
inputs=inputs,
outputs=[node.name],
**attr)
......@@ -1509,3 +1509,22 @@ class TFOpMapper(OpMapper):
inputs=inputs,
outputs=[node.name],
**attr)
def ReverseV2(self, node):
x = self.graph.get_input_node(node, 0)
axis = self.graph.get_input_node(node, 1)
inputs = {"x": x.name}
attr = dict()
if axis.layer_type == 'Const':
axis = axis.value.tolist()
if not isinstance(axis, list):
axis = [axis]
attr['axis'] = axis
else:
inputs['axis'] = axis.name
self.paddle_graph.add_layer(
"paddle.flip",
inputs=inputs,
outputs=[node.name],
**attr)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册