提交 1deb091c 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!1529 support tensor set item the number value type is similar as tensor dtype

Merge pull request !1529 from zhangbuxue/support_tensor_setitem_the_number_value_type_and_tensor_dtype_not_same
......@@ -280,7 +280,7 @@ def check_value_elements(data_dtype, types):
else:
raise TypeError(f"For '{TENSOR_SETITEM}', the data type of {i}th tensor '{ele_dtype}' "
f"in value tuple is not consistent with origin tensor data type '{data_dtype}'.")
elif mstype.issubclass_(ele, data_dtype):
elif mstype.dtype_to_pytype(ele) == mstype.dtype_to_pytype(data_dtype):
scalars_number += 1
else:
raise TypeError(f"For '{TENSOR_SETITEM}', the {i}th element type '{ele}' in "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册