diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 57a22116cdae505a1a511975b646eba7d2c8165b..3322519fcda046c813f3590a3626c6ec69741e7d 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -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)