Browse Source

Fix reviewbot warning for `debug`, `ir`, `optimizer`, `pipeline`, `utils` and `vm` modules.

tags/v0.5.0-beta
seatea 5 years ago
parent
commit
706054eb46
4 changed files with 6 additions and 5 deletions
  1. +1
    -1
      mindspore/ccsrc/debug/trace_info.h
  2. +1
    -1
      mindspore/ccsrc/ir/param_value_py.h
  3. +0
    -1
      mindspore/ccsrc/pipeline/static_analysis/static_analysis.h
  4. +4
    -2
      mindspore/ccsrc/vm/vm.cc

+ 1
- 1
mindspore/ccsrc/debug/trace_info.h View File

@@ -45,7 +45,7 @@ class TraceInfo : public Base {
} }
TraceInfo(const TraceInfo &info) TraceInfo(const TraceInfo &info)
: Base(), debug_info_(info.debug_info_), symbol_(info.symbol_), full_name_(info.full_name_), name_(info.name_) {} : Base(), debug_info_(info.debug_info_), symbol_(info.symbol_), full_name_(info.full_name_), name_(info.name_) {}
virtual ~TraceInfo() = default;
~TraceInfo() override = default;
MS_DECLARE_PARENT(TraceInfo, Base); MS_DECLARE_PARENT(TraceInfo, Base);
virtual std::string name() { return name_; } virtual std::string name() { return name_; }
virtual std::string symbol() { return symbol_; } virtual std::string symbol() { return symbol_; }


+ 1
- 1
mindspore/ccsrc/ir/param_value_py.h View File

@@ -29,7 +29,7 @@ class ParamValuePy : public ParamValue {
public: public:
ParamValuePy() : value_(py::none()) {} ParamValuePy() : value_(py::none()) {}
explicit ParamValuePy(py::object value) : value_(value) {} explicit ParamValuePy(py::object value) : value_(value) {}
virtual ~ParamValuePy() = default;
~ParamValuePy() override = default;


py::object value() { return value_; } py::object value() { return value_; }
void set_value(const py::object &obj) { value_ = obj; } void set_value(const py::object &obj) { value_ = obj; }


+ 0
- 1
mindspore/ccsrc/pipeline/static_analysis/static_analysis.h View File

@@ -40,7 +40,6 @@


namespace mindspore { namespace mindspore {
namespace abstract { namespace abstract {

// define attribute value map // define attribute value map
using AttrValueMap = std::unordered_map<std::string, ValuePtr>; using AttrValueMap = std::unordered_map<std::string, ValuePtr>;
using AttrValueMapPtr = std::shared_ptr<AttrValueMap>; using AttrValueMapPtr = std::shared_ptr<AttrValueMap>;


+ 4
- 2
mindspore/ccsrc/vm/vm.cc View File

@@ -603,8 +603,9 @@ void FinalVM::InstPushPrim(const VectorRef &args) {
} }


BaseRef FinalVM::RunHook(const PrimitivePtr &prim, const VectorRef &args) { BaseRef FinalVM::RunHook(const PrimitivePtr &prim, const VectorRef &args) {
py::tuple py_args = py::tuple(args.size());
MS_LOG(DEBUG) << "input for operation:"; MS_LOG(DEBUG) << "input for operation:";
std::size_t args_size = args.size();
py::tuple py_args = py::tuple(args_size);
size_t i = 0; size_t i = 0;
for (auto &arg : args) { for (auto &arg : args) {
py_args[i] = BaseRefToPyData(arg); py_args[i] = BaseRefToPyData(arg);
@@ -622,7 +623,8 @@ BaseRef FinalVM::RunHook(const PrimitivePtr &prim, const VectorRef &args) {
if (is_cell) { if (is_cell) {
std::string cell_id = GetValue<std::string>(prim->GetAttr("cell_id")); std::string cell_id = GetValue<std::string>(prim->GetAttr("cell_id"));
if (_hook_grad.find(cell_id) != _hook_grad.end()) { if (_hook_grad.find(cell_id) != _hook_grad.end()) {
py::tuple hook_args = py::tuple(3);
std::size_t hook_args_size = 3;
py::tuple hook_args = py::tuple(hook_args_size);
hook_args[0] = cell_id; hook_args[0] = cell_id;
hook_args[1] = py::make_tuple(_hook_grad[cell_id]); hook_args[1] = py::make_tuple(_hook_grad[cell_id]);
hook_args[2] = py::make_tuple(py_args[2]); hook_args[2] = py::make_tuple(py_args[2]);


Loading…
Cancel
Save