Browse Source

!15595 enhance: output data & type when to tensor failed

From: @jonyguo
Reviewed-by: @kingxian,@liucunwei
Signed-off-by: @kingxian,@liucunwei
pull/15595/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
db92a4e7b8
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mindspore/common/tensor.py

+ 1
- 1
mindspore/common/tensor.py View File

@@ -93,7 +93,7 @@ class Tensor(Tensor_):
np.float16, np.float32, np.float64, np.bool_)
if isinstance(input_data, np.ndarray) and input_data.dtype not in valid_dtypes:
raise TypeError(f"For Tensor, the input_data is a numpy array, "
f"but it's data type is not in supported list:\
f"but it's data type: {input_data.dtype} is not in supported list:\
{list(i.__name__ for i in valid_dtypes)}.")
if isinstance(input_data, (tuple, list)):
if np.array(input_data).dtype not in valid_dtypes:


Loading…
Cancel
Save