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

Merge pull request #96 from Channingss/develop

change sum op to elementwise_add op (for paddlelite)
...@@ -640,10 +640,21 @@ class ONNXOpMapper(OpMapper): ...@@ -640,10 +640,21 @@ class ONNXOpMapper(OpMapper):
param_attr=attr) param_attr=attr)
def Sum(self, node): def Sum(self, node):
var_inps = [val for val in node.layer.input] val_inps = node.layer.input
node.fluid_code.add_layer("sum", inputs = {
inputs='[' + ', '.join(var_inps) + ']', "x": val_inps[0],
output=node) "y": val_inps[1],
}
node.fluid_code.add_layer("elementwise_add", inputs=inputs, output=node)
for ipt in val_inps[2:]:
inputs = {
"x": node.layer_name,
"y": ipt,
}
node.fluid_code.add_layer("elementwise_add",
inputs=inputs,
output=node)
def MatMul(self, node): def MatMul(self, node):
val_x = self.graph.get_node(node.layer.input[0], copy=True) val_x = self.graph.get_node(node.layer.input[0], copy=True)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册