clean_0720_master

This commit is contained in:
dingpeifei 2021-07-20 00:48:53 +08:00
parent 7f34d541df
commit c470857e35
6 changed files with 13 additions and 2 deletions

View File

@ -28,6 +28,7 @@ from mindspore.common import dtype as mstype
from mindspore._c_expression import Tensor as Tensor_
class Rel(Enum):
"""Numerical relationship between variables, logical relationship enumeration definition of range."""
# scalar compare
EQ = 1 # ==

View File

@ -643,7 +643,8 @@ def set_context(**kwargs):
a file by default, and turns off printing to the screen. If the file already exists, add a timestamp
suffix to the file. Default: ''.
enable_sparse (bool): Whether to enable sparsity feature. Default: False.
For details of sparsity and sparse tensor, please check `<https://www.mindspore.cn/doc/programming_guide/zh-CN/master/tensor.html>`_.
For details of sparsity and sparse tensor, please check
`<https://www.mindspore.cn/doc/programming_guide/zh-CN/master/tensor.html>`_.
max_call_depth (int): Specify the maximum depth of function call. Must be positive integer. Default: 1000.
env_config_path (str): Config path for DFX.
auto_tune_mode (str): The mode of auto tune when op building, get the best tiling performance,

View File

@ -290,6 +290,7 @@ def _get_env_config():
return config_dict
def _verify_config(kwargs):
"""
Verify log configurations.

View File

@ -27,7 +27,8 @@ try:
ms = import_module("mindspore")
except ModuleNotFoundError:
ms = None
finally:
pass
def _check_mul():
"""
@ -65,3 +66,5 @@ def run_check():
except Exception as e:
print("MindSpore running check failed.")
print(str(e))
finally:
pass

View File

@ -97,6 +97,8 @@ def _make_directory(path: str):
except PermissionError as e:
logger.error("No write permission on the directory(%r), error = %r", path, e)
raise TypeError("No write permission on the directory.")
finally:
pass
return real_path
@ -238,6 +240,8 @@ def read_proto(file_name, proto_format="MINDIR", display_data=False):
except BaseException as e:
logger.error("Failed to read the file `%s`, please check the correct of the file.", file_name)
raise ValueError(e.__str__())
finally:
pass
if proto_format == "MINDIR" and not display_data:
for param_proto in model.graph.parameter:

View File

@ -23,6 +23,7 @@ from mindspore.train.summary.summary_record import _cache_summary_tensor_data
_cur_net = None
def set_cur_net(net):
"""
Set current net for which we are using to save checkpoint.