diff --git a/mindspore/ccsrc/transform/graph_ir/convert.cc b/mindspore/ccsrc/transform/graph_ir/convert.cc index b1d84c33029..ffd80e76665 100644 --- a/mindspore/ccsrc/transform/graph_ir/convert.cc +++ b/mindspore/ccsrc/transform/graph_ir/convert.cc @@ -986,7 +986,7 @@ void DfGraphConvertor::BuildWhileSubGraph() { graph_name += "_body_graph"; graph_out = GetWhileBodyOutputs(); } - if (error_ == 0) { + if (error_ == SUCCESS) { if (df_graph_->GetName() != graph_name) { MS_LOG(DEBUG) << "convert anf graph name : " << df_graph_->GetName() << " to df graph name: " << graph_name; } diff --git a/mindspore/ccsrc/transform/graph_ir/transform_util.cc b/mindspore/ccsrc/transform/graph_ir/transform_util.cc index f0e62e5c36e..51e90f8d7d6 100644 --- a/mindspore/ccsrc/transform/graph_ir/transform_util.cc +++ b/mindspore/ccsrc/transform/graph_ir/transform_util.cc @@ -206,7 +206,7 @@ GeTensorPtr ConvertStringTensor(const MeTensorPtr &tensor, const std::string &fo char *string_element = new char[string_max_length]; size_t string_length = 0; for (size_t i = 0; i < elements_num; i++) { - std::fill_n(string_element, string_max_length, '\0'); + (void)std::fill_n(string_element, string_max_length, '\0'); for (size_t j = 0; j < string_max_length; j++) { char char_element = data_ptr[i * string_max_length * single_char_offset + single_char_offset * j]; if (static_cast(char_element) == 0) { diff --git a/mindspore/python/mindspore/common/api.py b/mindspore/python/mindspore/common/api.py index 30414fdb4c4..0d869bbf217 100644 --- a/mindspore/python/mindspore/common/api.py +++ b/mindspore/python/mindspore/common/api.py @@ -468,6 +468,10 @@ def ms_function(fn=None, input_signature=None, hash_args=None, jit_config=None): This allows the MindSpore runtime to apply optimizations based on graph. + Note: + If `input_signature` is specified, each input of `fn` must be a Tensor. And the input arguments for `fn` + will not accept `**kwargs`. + Args: fn (Function): The Python function that will be run as a graph. Default: None. input_signature (Tensor): The Tensor which describes the input arguments. The shape and dtype of the Tensor diff --git a/mindspore/python/mindspore/train/model.py b/mindspore/python/mindspore/train/model.py index 31212ff7469..657a5077bd4 100644 --- a/mindspore/python/mindspore/train/model.py +++ b/mindspore/python/mindspore/train/model.py @@ -713,7 +713,7 @@ class Model: dataset_helper.continue_send() - self._eval_durning_train(valid_infos, cb_params, list_callback) + self._eval_during_train(valid_infos, cb_params, list_callback) # In disaster recovery scenarios, need not to execute callbacks if this epoch executes failed. # Embedding cache server need not do epoch end callback, this process only run one step. @@ -742,8 +742,8 @@ class Model: list_callback.on_train_end(run_context) - def _eval_durning_train(self, valid_infos, cb_params, list_callback): - """Exec eval durnning train process.""" + def _eval_during_train(self, valid_infos, cb_params, list_callback): + """Exec eval during train process.""" valid_dataset, valid_frequency, valid_dataset_sink_mode = valid_infos if valid_dataset and self._should_eval(cb_params.cur_epoch_num, valid_frequency): train_cur_step_num = cb_params.cur_step_num @@ -921,7 +921,7 @@ class Model: if should_stop: break - self._eval_durning_train(valid_infos, cb_params, list_callback) + self._eval_during_train(valid_infos, cb_params, list_callback) train_dataset.reset()