!35258 modify white list

Merge pull request !35258 from 冯一航/code_docs_modify_checkparam
This commit is contained in:
i-robot 2022-05-31 09:24:54 +00:00 committed by Gitee
commit dcecfa5a1e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 1 deletions

View File

@ -493,11 +493,13 @@ class Validator:
if not hit:
if addition_error_info is None:
addition_error_info = ''
else:
addition_error_info = ' ' + addition_error_info
type_str = (f"type '{type(type_).__name__}'" if isinstance(type_, (tuple, list)) else str(type_))
raise TypeError(f"For '{prim_name}', the type of '{arg_name}'"
f" must be {'one of ' if len(template_types) > 1 else ''}"
f"{', '.join((str(x) for x in template_types))}, but got {type_str}"
f" {addition_error_info}.The supported data types depend on the hardware that"
f"{addition_error_info}.The supported data types depend on the hardware that"
f" executes the operator, for more details, please refer to the MindSpore official "
f"website to get more information about the data type.")