diff --git a/python/paddle/fluid/dygraph/varbase_patch_methods.py b/python/paddle/fluid/dygraph/varbase_patch_methods.py index 9eb044188f0d150bc4768245816bc30a620f4223..48497f4b9092f6a6c3f9e4684a9947a146481c3f 100644 --- a/python/paddle/fluid/dygraph/varbase_patch_methods.py +++ b/python/paddle/fluid/dygraph/varbase_patch_methods.py @@ -1039,8 +1039,11 @@ def monkey_patch_varbase(): def dtype_str(dtype): if dtype in _PADDLE_DTYPE_2_NUMPY_DTYPE: + numpy_dtype = _PADDLE_DTYPE_2_NUMPY_DTYPE[dtype] + if numpy_dtype == 'uint16': + numpy_dtype = 'bfloat16' prefix = 'paddle.' - return prefix + _PADDLE_DTYPE_2_NUMPY_DTYPE[dtype] + return prefix + numpy_dtype else: # for example, paddle.fluid.core.VarDesc.VarType.LOD_TENSOR return origin(dtype)