提交 46797f53 编写于 作者: D danleifeng 提交者: Chen Weihang

fix small bug of error message for elementwise_add and elementwise_mul (#20619)

* fix error message for elementwise_add/mul;test=develop

* fix type error message;test=develop
上级 40c258a7
......@@ -13772,24 +13772,24 @@ def _elementwise_op(helper):
(op_type, type(y)))
if convert_dtype(x.dtype) in ['float16']:
warnings.warn(
"The data type of 'x' in batch_norm only support float16 on GPU now."
)
"The data type of 'x' in %s only support float16 on GPU now." %
(op_type))
if convert_dtype(y.dtype) in ['float16']:
warnings.warn(
"The data type of 'y' in batch_norm only support float16 on GPU now."
)
"The data type of 'y' in %s only support float16 on GPU now." %
(op_type))
if convert_dtype(x.dtype) not in [
'float16', 'float32', 'float64', 'int32', 'int64'
]:
raise TypeError(
"The data type of 'x' in batch_norm must be float16 or float32 or float64 or int32 or int64, but received %s."
% (convert_dtype(x.dtype)))
"The data type of 'x' in %s must be float16 or float32 or float64 or int32 or int64, "
"but received %s." % (op_type, convert_dtype(x.dtype)))
if convert_dtype(y.dtype) not in [
'float16', 'float32', 'float64', 'int32', 'int64'
]:
raise TypeError(
"The data type of 'y' in batch_norm must be float16 or float32 or float64 or int32 or int64, but received %s."
% (convert_dtype(y.dtype)))
"The data type of 'y' in %s must be float16 or float32 or float64 or int32 or int64, "
"but received %s." % (op_type, convert_dtype(y.dtype)))
axis = helper.kwargs.get('axis', -1)
use_mkldnn = helper.kwargs.get('use_mkldnn', False)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册