提交 edc2430a 编写于 作者: R root

fix bug for op:NonZero

上级 930f6025
...@@ -1103,7 +1103,7 @@ class ONNXOpMapper(OpMapper): ...@@ -1103,7 +1103,7 @@ class ONNXOpMapper(OpMapper):
val_x = self.graph.get_input_node(node, idx=0, copy=True) val_x = self.graph.get_input_node(node, idx=0, copy=True)
where_name = node.layer_name + '_where' where_name = node.layer_name + '_where'
node.fluid_code.add_layer("where", node.fluid_code.add_layer("where",
inputs=val_x.layer_name + '==1', inputs=val_x.layer_name + '!=0',
output=where_name) output=where_name)
dims = len(val_x.out_shapes[0]) dims = len(val_x.out_shapes[0])
elements_count_val_x = reduce(lambda x, y: x * y, val_x.out_shapes[0]) elements_count_val_x = reduce(lambda x, y: x * y, val_x.out_shapes[0])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册