!27025 optimized error msg
Merge pull request !27025 from chentangyu/ms_cty_master_I4KJSH
This commit is contained in:
commit
e30800e011
|
@ -321,8 +321,8 @@ def get_pos_of_indexes_types(indexes_types, op_name):
|
|||
elif isinstance(index_type, (list, tuple)):
|
||||
sequence_positions += (i,)
|
||||
else:
|
||||
raise IndexError(f"For '{op_name}', the index elements only support 'Slice', 'Ellipsis', 'None', "
|
||||
f"'Tensor', 'int', 'List', 'Tuple', 'bool' but got {index_type}.")
|
||||
raise TypeError(f"For '{op_name}', the types only support 'Slice', 'Ellipsis', 'None', 'Tensor', 'int', "
|
||||
f"'List', 'Tuple', 'bool', but got {index_type}.")
|
||||
if len(ellipsis_positions) > 1:
|
||||
raise IndexError(
|
||||
f"For '{op_name}, an index can only have a single ellipsis('...')")
|
||||
|
|
Loading…
Reference in New Issue