未验证 提交 fa19d251 编写于 作者: J Jason 提交者: GitHub

Merge pull request #445 from SunAhong1993/paddle-2.0

Paddle 2.0
......@@ -248,6 +248,15 @@ class TFOpMapper(OpMapper):
inputs={"x": input.name},
outputs=[node.name],
perm=perm)
def Neg(self, node):
input = self.graph.get_input_node(node, 0)
self.paddle_graph.add_layer(
"paddle.scale",
inputs={"x": input.name},
outputs=[node.name],
scale=-1)
def Fill(self, node):
dims = self.graph.get_input_node(node, 0)
......
......@@ -304,6 +304,15 @@ class TFOpMapper(OpMapper):
inputs={"x": node.name},
outputs=[node.name],
perm=[0, 2, 3, 1])
def Neg(self, node):
input = self.graph.get_input_node(node, 0)
self.paddle_graph.add_layer(
"paddle.scale",
inputs={"x": input.name},
outputs=[node.name],
scale=-1)
def MaxPool(self, node):
input = self.graph.get_node(node.layer.input[0])
......
......@@ -118,5 +118,5 @@ class PReLUOpt:
graph.layers[transpose0.id] = transpose0
graph.layers[prelu.id] = prelu
graph.layers[transpose1.id] = transpose1
graph.parameters[alpha.outputs[0]] = np.expand_dims(graph.parameters[alpha.outputs[0]], axis=(0, 2, 3))
graph.parameters[alpha.outputs[0]] = np.reshape(graph.parameters[alpha.outputs[0]], (1, 0, 1, 1))
graph.build()
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册