clear_warning

This commit is contained in:
fengyihang 2022-08-16 10:43:14 +08:00
parent 8ab98ed52f
commit 7e3572ce7a
2 changed files with 3 additions and 3 deletions

View File

@ -5850,7 +5850,7 @@ def _check_astype_and_convert(dtype):
dtype = mstype.pytype_to_dtype(np.dtype(dtype.lower()))
elif isinstance(dtype, type):
dtype = mstype.pytype_to_dtype(dtype)
elif not dtype in mstype.number_type + (mstype.bool_,):
elif dtype not in mstype.number_type + (mstype.bool_,):
raise TypeError(
f"For Tensor.astype, the input type must be one of {list(mstype.number_type + (mstype.bool_,) + np_types)},"
f" but got '{dtype}'.")

View File

@ -77,7 +77,7 @@ def _auto_white_list(network, white_list=None):
subcell = cells[name]
if subcell == network:
continue
elif isinstance(subcell, white_list):
if isinstance(subcell, white_list):
network._cells[name] = _OutputTo32(subcell.to_float(mstype.float16))
change = True
else:
@ -97,7 +97,7 @@ def _auto_black_list(network, black_list=None):
subcell = cells[name]
if subcell == network:
continue
elif isinstance(subcell, black_list):
if isinstance(subcell, black_list):
network._cells[name] = _OutputTo16(subcell.to_float(mstype.float32))
change = True
else: