提交 0489f6d5 编写于 作者: C Channingss

fix bug

上级 e164cf67
...@@ -308,8 +308,16 @@ class PaddleOpMapper(object): ...@@ -308,8 +308,16 @@ class PaddleOpMapper(object):
scale = op.attr('scale') scale = op.attr('scale')
bias = op.attr('bias') bias = op.attr('bias')
if math.fabs(scale - 1.0) < 1e-06 and math.fabs(bias - 0.0) < 1e-06: if math.fabs(scale - 1.0) < 1e-06 and math.fabs(bias - 0.0) < 1e-06:
name = op.output('Out')[0]
var = block.var(name)
dtype = self.paddle_onnx_dtype_map[var.dtype]
node = helper.make_node( node = helper.make_node(
'Identity', inputs=op.input('X'), outputs=op.output('Out')) 'Cast',
inputs=op.input('X'),
outputs=op.output('Out'),
to=dtype)
#node = helper.make_node(
# 'Identity', inputs=op.input('X'), outputs=op.output('Out'))
return node return node
else: else:
scale_name = self.get_name(op.type, 'scale') scale_name = self.get_name(op.type, 'scale')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册