clear_warning
This commit is contained in:
parent
8ab98ed52f
commit
7e3572ce7a
|
@ -5850,7 +5850,7 @@ def _check_astype_and_convert(dtype):
|
||||||
dtype = mstype.pytype_to_dtype(np.dtype(dtype.lower()))
|
dtype = mstype.pytype_to_dtype(np.dtype(dtype.lower()))
|
||||||
elif isinstance(dtype, type):
|
elif isinstance(dtype, type):
|
||||||
dtype = mstype.pytype_to_dtype(dtype)
|
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(
|
raise TypeError(
|
||||||
f"For Tensor.astype, the input type must be one of {list(mstype.number_type + (mstype.bool_,) + np_types)},"
|
f"For Tensor.astype, the input type must be one of {list(mstype.number_type + (mstype.bool_,) + np_types)},"
|
||||||
f" but got '{dtype}'.")
|
f" but got '{dtype}'.")
|
||||||
|
|
|
@ -77,7 +77,7 @@ def _auto_white_list(network, white_list=None):
|
||||||
subcell = cells[name]
|
subcell = cells[name]
|
||||||
if subcell == network:
|
if subcell == network:
|
||||||
continue
|
continue
|
||||||
elif isinstance(subcell, white_list):
|
if isinstance(subcell, white_list):
|
||||||
network._cells[name] = _OutputTo32(subcell.to_float(mstype.float16))
|
network._cells[name] = _OutputTo32(subcell.to_float(mstype.float16))
|
||||||
change = True
|
change = True
|
||||||
else:
|
else:
|
||||||
|
@ -97,7 +97,7 @@ def _auto_black_list(network, black_list=None):
|
||||||
subcell = cells[name]
|
subcell = cells[name]
|
||||||
if subcell == network:
|
if subcell == network:
|
||||||
continue
|
continue
|
||||||
elif isinstance(subcell, black_list):
|
if isinstance(subcell, black_list):
|
||||||
network._cells[name] = _OutputTo16(subcell.to_float(mstype.float32))
|
network._cells[name] = _OutputTo16(subcell.to_float(mstype.float32))
|
||||||
change = True
|
change = True
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue