commit
431cc66e72
|
@ -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}'.")
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue