Commit 789afa39 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

fix cppcheck errors

parent 5a0c8ca7
...@@ -88,8 +88,12 @@ void quantize(program& prog, const std::vector<std::string>& ins_names) ...@@ -88,8 +88,12 @@ void quantize(program& prog, const std::vector<std::string>& ins_names)
} }
} }
if(inputs != converted_inputs) // no change for the input, return directly
if (inputs == converted_inputs)
{ {
return;
}
auto op = ins->get_operator(); auto op = ins->get_operator();
auto ins_shape = compute_shape(op, converted_inputs); auto ins_shape = compute_shape(op, converted_inputs);
if(ins_shape.type() != orig_type) if(ins_shape.type() != orig_type)
...@@ -114,7 +118,6 @@ void quantize(program& prog, const std::vector<std::string>& ins_names) ...@@ -114,7 +118,6 @@ void quantize(program& prog, const std::vector<std::string>& ins_names)
prog.replace_instruction(ins, op, converted_inputs); prog.replace_instruction(ins, op, converted_inputs);
} }
}
} }
} // namespace MIGRAPHX_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
......
...@@ -17,7 +17,7 @@ struct hip_convert : unary_device<hip_convert, device::convert> ...@@ -17,7 +17,7 @@ struct hip_convert : unary_device<hip_convert, device::convert>
op::convert op; op::convert op;
hip_convert(const op::convert& oper) : op(oper) {} hip_convert(const op::convert& oper) : op(oper) {}
hip_convert(const op::convert&& oper) : op(std::move(oper)) {} hip_convert(const op::convert&& oper) : op(oper) {}
shape compute_shape(std::vector<shape> inputs) const shape compute_shape(std::vector<shape> inputs) const
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment