From 1c58e0de1a82fde203120e6e1b6c17f8e8bd57ec Mon Sep 17 00:00:00 2001 From: "wangnan39@huawei.com" Date: Thu, 18 Mar 2021 10:52:35 +0800 Subject: [PATCH] add annotation for python api and modify some log level --- mindspore/core/utils/check_convert_utils.cc | 8 ++++---- mindspore/nn/cell.py | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mindspore/core/utils/check_convert_utils.cc b/mindspore/core/utils/check_convert_utils.cc index 3ad3fbf2a2..d58ccffcfd 100644 --- a/mindspore/core/utils/check_convert_utils.cc +++ b/mindspore/core/utils/check_convert_utils.cc @@ -232,7 +232,7 @@ bool CheckAndConvertUtils::ConvertAttrValueToInt(const std::string &op_type, con bool CheckAndConvertUtils::ConvertAttrValueToString(const std::string &op_type, const std::string &attr_name, ValuePtr *const value) { if (value == nullptr || *value == nullptr) { - MS_LOG(INFO) << "value is nullptr! op_type = " << op_type << ", attr_name = " << attr_name; + MS_LOG(DEBUG) << "value is nullptr! op_type = " << op_type << ", attr_name = " << attr_name; return false; } if (!(*value)->isa()) { @@ -282,7 +282,7 @@ void RestoreTargetAttr(const std::string &attr_name, ValuePtr *const value) { void CheckAndConvertUtils::ConvertAttrValueInExport(const std::string &op_type, const std::string &attr_name, ValuePtr *const value) { if (value == nullptr || *value == nullptr) { - MS_LOG(INFO) << "value is nullptr! op_type = " << op_type << ", attr_name = " << attr_name; + MS_LOG(DEBUG) << "value is nullptr! op_type = " << op_type << ", attr_name = " << attr_name; return; } // convert enum to string @@ -294,7 +294,7 @@ void CheckAndConvertUtils::ConvertAttrValueInExport(const std::string &op_type, void CheckAndConvertUtils::ConvertAttrValueInLoad(const std::string &op_type, const std::string &attr_name, ValuePtr *const value) { if (value == nullptr || *value == nullptr) { - MS_LOG(INFO) << "value is nullptr! op_type = " << op_type << ", attr_name = " << attr_name; + MS_LOG(DEBUG) << "value is nullptr! op_type = " << op_type << ", attr_name = " << attr_name; return; } // convert string to enum @@ -628,7 +628,7 @@ TypeId CheckAndConvertUtils::CheckTypeSame(const std::string &arg_name, const Ty bool CheckAndConvertUtils::CheckIrAttrtoOpAttr(const std::string &op_type, const std::string &attr_name, ValuePtr *const value) { if (*value == nullptr) { - MS_LOG(INFO) << "value is nullptr! op_type = " << op_type << ", attr_name = " << attr_name; + MS_LOG(DEBUG) << "value is nullptr! op_type = " << op_type << ", attr_name = " << attr_name; return false; } if (op_type.empty() || attr_name.empty()) { diff --git a/mindspore/nn/cell.py b/mindspore/nn/cell.py index 621ee06d08..e999444fad 100755 --- a/mindspore/nn/cell.py +++ b/mindspore/nn/cell.py @@ -1051,7 +1051,8 @@ class Cell(Cell_): """ Sets the cell to training mode. - The cell itself and all children cells will be set to training mode. + The cell itself and all children cells will be set to training mode. Layers that have different constructions + for training and predicting , such as `BatchNorm`, will distinguish between the branches by this attribute. Args: mode (bool): Specifies whether the model is training. Default: True.