forked from mindspore-Ecosystem/mindspore
!23785 code check clean
Merge pull request !23785 from liutongtong9/codecheck_ma
This commit is contained in:
commit
70c8263a17
|
@ -28,6 +28,7 @@ from mindspore import log as logger
|
|||
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."""
|
||||
|
@ -827,9 +828,12 @@ class Validator:
|
|||
return True
|
||||
|
||||
type_str = ""
|
||||
if type_int: type_str += "int, "
|
||||
if type_tuple: type_str += "tuple, "
|
||||
if type_list: type_str += "list, "
|
||||
if type_int:
|
||||
type_str += "int, "
|
||||
if type_tuple:
|
||||
type_str += "tuple, "
|
||||
if type_list:
|
||||
type_str += "list, "
|
||||
raise TypeError(f"Axis should be {type_str}but got {type(axis)}.")
|
||||
|
||||
@staticmethod
|
||||
|
@ -968,6 +972,7 @@ def args_unreset_check(*unreset_args, **unreset_kwargs):
|
|||
def unreset_check(func):
|
||||
sig = inspect.signature(func)
|
||||
bound_unreset = sig.bind_partial(*unreset_args, **unreset_kwargs).arguments
|
||||
|
||||
@wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
nonlocal bound_unreset
|
||||
|
|
|
@ -509,6 +509,7 @@ def _check_target_specific_cfgs(device, arg_key):
|
|||
", ignore it.")
|
||||
return False
|
||||
|
||||
|
||||
@args_unreset_check(device_id=int, variable_memory_max_size=str, max_device_memory=str)
|
||||
@args_type_check(mode=int, precompile_only=bool, device_target=str, device_id=int, save_graphs=bool,
|
||||
save_graphs_path=str, enable_dump=bool, auto_tune_mode=str,
|
||||
|
|
|
@ -269,6 +269,7 @@ def _get_env_config():
|
|||
config_dict[key] = value.strip()
|
||||
return config_dict
|
||||
|
||||
|
||||
def _verify_config(kwargs):
|
||||
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue