未验证 提交 3d5d1173 编写于 作者: H HongyuJia 提交者: GitHub

fix dtype error of add/sub/mul/div_with_axis (#49179)

上级 1b8d1d36
...@@ -1022,11 +1022,6 @@ def _add_with_axis(x, y, axis=-1, name=None): ...@@ -1022,11 +1022,6 @@ def _add_with_axis(x, y, axis=-1, name=None):
x, y, axis=axis, act=act, op_name=op_type x, y, axis=axis, act=act, op_name=op_type
) )
else: else:
if x.dtype != y.dtype:
raise TypeError(
'Input tensors must be same type, but received type of x: %s, type of y: %s '
% (x.dtype, y.dtype)
)
return _elementwise_op(LayerHelper(op_type, **locals())) return _elementwise_op(LayerHelper(op_type, **locals()))
...@@ -1044,11 +1039,6 @@ def _subtract_with_axis(x, y, axis=-1, name=None): ...@@ -1044,11 +1039,6 @@ def _subtract_with_axis(x, y, axis=-1, name=None):
x, y, axis=axis, act=act, op_name=op_type x, y, axis=axis, act=act, op_name=op_type
) )
else: else:
if x.dtype != y.dtype:
raise TypeError(
'Input tensors must be same type, but received type of x: %s, type of y: %s '
% (x.dtype, y.dtype)
)
return _elementwise_op(LayerHelper(op_type, **locals())) return _elementwise_op(LayerHelper(op_type, **locals()))
...@@ -1066,11 +1056,6 @@ def _multiply_with_axis(x, y, axis=-1, name=None): ...@@ -1066,11 +1056,6 @@ def _multiply_with_axis(x, y, axis=-1, name=None):
x, y, axis=axis, act=act, op_name=op_type x, y, axis=axis, act=act, op_name=op_type
) )
else: else:
if x.dtype != y.dtype:
raise TypeError(
'Input tensors must be same type, but received type of x: %s, type of y: %s '
% (x.dtype, y.dtype)
)
return _elementwise_op(LayerHelper(op_type, **locals())) return _elementwise_op(LayerHelper(op_type, **locals()))
...@@ -1086,11 +1071,6 @@ def _divide_with_axis(x, y, axis=-1, name=None): ...@@ -1086,11 +1071,6 @@ def _divide_with_axis(x, y, axis=-1, name=None):
x, y, axis=axis, act=act, op_name=op_type x, y, axis=axis, act=act, op_name=op_type
) )
else: else:
if x.dtype != y.dtype:
raise TypeError(
'Input tensors must be same type, but received type of x: %s, type of y: %s '
% (x.dtype, y.dtype)
)
return _elementwise_op(LayerHelper(op_type, **locals())) return _elementwise_op(LayerHelper(op_type, **locals()))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册