!26921 Modify Error Information

Merge pull request !26921 from liuyang/error_ms
This commit is contained in:
i-robot 2021-11-30 02:59:18 +00:00 committed by Gitee
commit f9b9e6add6
2 changed files with 12 additions and 12 deletions

View File

@ -244,8 +244,8 @@ class Cell(Cell_):
@parameter_layout_dict.setter
def parameter_layout_dict(self, value):
if not isinstance(value, dict):
raise TypeError("The type of parameter 'value' must be a dict type, "
"but got the type : {}.".format(type(value)))
raise TypeError(f"For 'Cell', the property 'parameter_layout_dict' must be dict type, "
f"but got type {type(value)}.")
self._parameter_layout_dict = value
@property
@ -255,8 +255,8 @@ class Cell(Cell_):
@parallel_parameter_name_list.setter
def parallel_parameter_name_list(self, value):
if not isinstance(value, list):
raise TypeError("The type of parameter 'parallel_parameter_name_list' must be a list type, "
"but got the type : {}.".format(type(value)))
raise TypeError(f"For 'Cell', the property 'parallel_parameter_name_list' must be list type, "
f"but got type {type(value)}.")
self._parallel_parameter_name_list = value
@property
@ -265,13 +265,13 @@ class Cell(Cell_):
@pipeline_stage.setter
def pipeline_stage(self, value):
if not isinstance(value, int) or isinstance(value, bool):
raise TypeError("The parameter 'pipeline_stage' must be an int type, "
"but got the type : {}.".format(type(value)))
if not isinstance(value, int):
raise TypeError(f"For 'Cell', the property 'pipeline_stage' must be int type, "
f"but got type {type(value)}.")
if value < 0:
raise TypeError("The parameter 'pipeline_stage' can not be less than 0, "
"but got the value : {}".format(value))
raise TypeError("For 'Cell', the property 'pipeline_stage' can not be less than 0, "
"but got {}".format(value))
self._pipeline_stage = value
for item in self.trainable_params():
item.add_pipeline_stage(value)
@ -283,8 +283,8 @@ class Cell(Cell_):
@parallel_parameter_merge_net_dict.setter
def parallel_parameter_merge_net_dict(self, value):
if not isinstance(value, dict):
raise TypeError("The parameter 'parallel_parameter_merge_net_dict' must be a dict type, "
"but got the type : {}".format(type(value)))
raise TypeError(f"For 'Cell', the property 'parallel_parameter_merge_net_dict' must be dict type, "
f"but got type {type(value)}.")
self._parallel_parameter_merge_net_dict = value
def get_func_graph_proto(self):