Merge pull request !1321 from rick_sanchez/mastertags/v0.3.0-alpha
| @@ -17,8 +17,6 @@ | |||||
| #include "utils/log_adapter.h" | #include "utils/log_adapter.h" | ||||
| namespace mindspore { | namespace mindspore { | ||||
| // set default log level to WARNING for all sub modules | // set default log level to WARNING for all sub modules | ||||
| int g_ms_submodule_log_levels[NUM_SUBMODUES] = {WARNING}; | int g_ms_submodule_log_levels[NUM_SUBMODUES] = {WARNING}; | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -99,5 +99,4 @@ std::string CNode::fullname_with_scope() { | |||||
| void CNode::accept(AnfVisitor *v) { v->Visit(shared_from_base<CNode>()); } | void CNode::accept(AnfVisitor *v) { v->Visit(shared_from_base<CNode>()); } | ||||
| void ValueNode::accept(AnfVisitor *v) { v->Visit(shared_from_base<ValueNode>()); } | void ValueNode::accept(AnfVisitor *v) { v->Visit(shared_from_base<ValueNode>()); } | ||||
| void Parameter::accept(AnfVisitor *v) { v->Visit(shared_from_base<Parameter>()); } | void Parameter::accept(AnfVisitor *v) { v->Visit(shared_from_base<Parameter>()); } | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -275,7 +275,6 @@ class AdjustAllReduceMulAdd : public AnfVisitor { | |||||
| // If has dynamic loss scale. | // If has dynamic loss scale. | ||||
| auto &users_map = fg->manager()->node_users(); | auto &users_map = fg->manager()->node_users(); | ||||
| auto it = users_map.find(mul_cnode_); | auto it = users_map.find(mul_cnode_); | ||||
| if (it != users_map.end()) { | if (it != users_map.end()) { | ||||
| auto users = it->second; | auto users = it->second; | ||||
| for (auto &user_pair : users) { | for (auto &user_pair : users) { | ||||
| @@ -92,15 +92,12 @@ inline bool isTraversable(const AnfNodePtr &node) { | |||||
| if (node == nullptr) { | if (node == nullptr) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (node->isa<CNode>() || node->isa<Parameter>()) { | if (node->isa<CNode>() || node->isa<Parameter>()) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| if (IsValueNode<FuncGraph>(node) || IsValueNode<RefKey>(node)) { | if (IsValueNode<FuncGraph>(node) || IsValueNode<RefKey>(node)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -287,7 +287,7 @@ static bool IsCtrlSink() { | |||||
| return false; | return false; | ||||
| } | } | ||||
| char *enable_ctrl_sink = std::getenv("ENABLE_CTRL_SINK"); | |||||
| const char *enable_ctrl_sink = std::getenv("ENABLE_CTRL_SINK"); | |||||
| if (enable_ctrl_sink == nullptr) { | if (enable_ctrl_sink == nullptr) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -63,12 +63,11 @@ class Ensures : public EnsuresAccess<T, R> { | |||||
| Ensures(const Ensures<O, R> &other) : value_(other.get()) {} | Ensures(const Ensures<O, R> &other) : value_(other.get()) {} | ||||
| ~Ensures() = default; | ~Ensures() = default; | ||||
| T get() const { return value_; } | |||||
| const T get() const { return value_; } | |||||
| T &get() { return value_; } | T &get() { return value_; } | ||||
| operator T() const { return value_; } | |||||
| operator const T() const { return value_; } | |||||
| private: | |||||
| T value_; | T value_; | ||||
| }; | }; | ||||
| @@ -86,7 +86,7 @@ bool PrintTensorToString(const char *str_data_ptr, mindspore::tensor::Tensor *co | |||||
| } | } | ||||
| template <typename T> | template <typename T> | ||||
| void PrintScalarToString(const char *str_data_ptr, const string &tensor_type, std::ostringstream *buf) { | |||||
| void PrintScalarToString(const char *str_data_ptr, const string &tensor_type, std::ostringstream *const buf) { | |||||
| MS_EXCEPTION_IF_NULL(str_data_ptr); | MS_EXCEPTION_IF_NULL(str_data_ptr); | ||||
| MS_EXCEPTION_IF_NULL(buf); | MS_EXCEPTION_IF_NULL(buf); | ||||
| const T *data_ptr = reinterpret_cast<const T *>(str_data_ptr); | const T *data_ptr = reinterpret_cast<const T *>(str_data_ptr); | ||||
| @@ -95,7 +95,7 @@ void PrintScalarToString(const char *str_data_ptr, const string &tensor_type, st | |||||
| *buf << *data_ptr << "\n"; | *buf << *data_ptr << "\n"; | ||||
| } | } | ||||
| void PrintScalarToBoolString(const char *str_data_ptr, const string &tensor_type, std::ostringstream *buf) { | |||||
| void PrintScalarToBoolString(const char *str_data_ptr, const string &tensor_type, std::ostringstream *const buf) { | |||||
| MS_EXCEPTION_IF_NULL(str_data_ptr); | MS_EXCEPTION_IF_NULL(str_data_ptr); | ||||
| MS_EXCEPTION_IF_NULL(buf); | MS_EXCEPTION_IF_NULL(buf); | ||||
| const bool *data_ptr = reinterpret_cast<const bool *>(str_data_ptr); | const bool *data_ptr = reinterpret_cast<const bool *>(str_data_ptr); | ||||
| @@ -108,7 +108,7 @@ void PrintScalarToBoolString(const char *str_data_ptr, const string &tensor_type | |||||
| } | } | ||||
| } | } | ||||
| void convertDataItem2Scalar(const char *str_data_ptr, const string &tensor_type, std::ostringstream *buf) { | |||||
| void convertDataItem2Scalar(const char *str_data_ptr, const string &tensor_type, std::ostringstream *const buf) { | |||||
| MS_EXCEPTION_IF_NULL(str_data_ptr); | MS_EXCEPTION_IF_NULL(str_data_ptr); | ||||
| MS_EXCEPTION_IF_NULL(buf); | MS_EXCEPTION_IF_NULL(buf); | ||||
| auto type_iter = print_type_map.find(tensor_type); | auto type_iter = print_type_map.find(tensor_type); | ||||