forked from huawei/mindspore2022
fix codex and reviewbot
This commit is contained in:
parent
19c200e9cc
commit
19dfc98006
|
|
@ -17,8 +17,6 @@
|
|||
#include "utils/log_adapter.h"
|
||||
|
||||
namespace mindspore {
|
||||
|
||||
// set default log level to WARNING for all sub modules
|
||||
int g_ms_submodule_log_levels[NUM_SUBMODUES] = {WARNING};
|
||||
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -99,5 +99,4 @@ std::string CNode::fullname_with_scope() {
|
|||
void CNode::accept(AnfVisitor *v) { v->Visit(shared_from_base<CNode>()); }
|
||||
void ValueNode::accept(AnfVisitor *v) { v->Visit(shared_from_base<ValueNode>()); }
|
||||
void Parameter::accept(AnfVisitor *v) { v->Visit(shared_from_base<Parameter>()); }
|
||||
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -275,7 +275,6 @@ class AdjustAllReduceMulAdd : public AnfVisitor {
|
|||
// If has dynamic loss scale.
|
||||
auto &users_map = fg->manager()->node_users();
|
||||
auto it = users_map.find(mul_cnode_);
|
||||
|
||||
if (it != users_map.end()) {
|
||||
auto users = it->second;
|
||||
for (auto &user_pair : users) {
|
||||
|
|
|
|||
|
|
@ -92,15 +92,12 @@ inline bool isTraversable(const AnfNodePtr &node) {
|
|||
if (node == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (node->isa<CNode>() || node->isa<Parameter>()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (IsValueNode<FuncGraph>(node) || IsValueNode<RefKey>(node)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ static bool IsCtrlSink() {
|
|||
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) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,12 +63,11 @@ class Ensures : public EnsuresAccess<T, R> {
|
|||
Ensures(const Ensures<O, R> &other) : value_(other.get()) {}
|
||||
~Ensures() = default;
|
||||
|
||||
T get() const { return value_; }
|
||||
const T get() const { return value_; }
|
||||
T &get() { return value_; }
|
||||
|
||||
operator T() const { return value_; }
|
||||
operator const T() const { return value_; }
|
||||
|
||||
private:
|
||||
T value_;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ bool PrintTensorToString(const char *str_data_ptr, mindspore::tensor::Tensor *co
|
|||
}
|
||||
|
||||
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(buf);
|
||||
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";
|
||||
}
|
||||
|
||||
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(buf);
|
||||
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(buf);
|
||||
auto type_iter = print_type_map.find(tensor_type);
|
||||
|
|
|
|||
Loading…
Reference in New Issue