forked from mindspore-Ecosystem/mindspore
!40650 Clean Code Modification
Merge pull request !40650 from shaojunsong/clean_code820
This commit is contained in:
commit
0b3d48a058
|
@ -3418,10 +3418,10 @@ class Tensor(Tensor_):
|
|||
|
||||
try:
|
||||
data = np.ndarray(shape, dtype=mstype.dtype_to_nptype(self.dtype))
|
||||
except ValueError:
|
||||
except ValueError as e:
|
||||
msg = "Error shape={}".format(shape)
|
||||
logger.critical(msg)
|
||||
raise ValueError(msg)
|
||||
raise ValueError(msg) from e
|
||||
|
||||
class seed_context:
|
||||
"""Set and restore seed."""
|
||||
|
|
Loading…
Reference in New Issue