Fix reviewbot warning for `debug`, `ir`, `optimizer`, `pipeline`, `utils` and `vm` modules.
This commit is contained in:
parent
ec5363ad9d
commit
706054eb46
|
@ -45,7 +45,7 @@ class TraceInfo : public Base {
|
|||
}
|
||||
TraceInfo(const TraceInfo &info)
|
||||
: 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);
|
||||
virtual std::string name() { return name_; }
|
||||
virtual std::string symbol() { return symbol_; }
|
||||
|
|
|
@ -29,7 +29,7 @@ class ParamValuePy : public ParamValue {
|
|||
public:
|
||||
ParamValuePy() : value_(py::none()) {}
|
||||
explicit ParamValuePy(py::object value) : value_(value) {}
|
||||
virtual ~ParamValuePy() = default;
|
||||
~ParamValuePy() override = default;
|
||||
|
||||
py::object value() { return value_; }
|
||||
void set_value(const py::object &obj) { value_ = obj; }
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
|
||||
namespace mindspore {
|
||||
namespace abstract {
|
||||
|
||||
// define attribute value map
|
||||
using AttrValueMap = std::unordered_map<std::string, ValuePtr>;
|
||||
using AttrValueMapPtr = std::shared_ptr<AttrValueMap>;
|
||||
|
|
|
@ -603,8 +603,9 @@ void FinalVM::InstPushPrim(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:";
|
||||
std::size_t args_size = args.size();
|
||||
py::tuple py_args = py::tuple(args_size);
|
||||
size_t i = 0;
|
||||
for (auto &arg : args) {
|
||||
py_args[i] = BaseRefToPyData(arg);
|
||||
|
@ -622,7 +623,8 @@ BaseRef FinalVM::RunHook(const PrimitivePtr &prim, const VectorRef &args) {
|
|||
if (is_cell) {
|
||||
std::string cell_id = GetValue<std::string>(prim->GetAttr("cell_id"));
|
||||
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[1] = py::make_tuple(_hook_grad[cell_id]);
|
||||
hook_args[2] = py::make_tuple(py_args[2]);
|
||||
|
|
Loading…
Reference in New Issue