"mmdet3d/vscode:/vscode.git/clone" did not exist on "f842ff96daeff8e4fb953a0688bfd47b3e651b97"
Commit 28edb6fc authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 13e4b719
...@@ -18,7 +18,8 @@ inline namespace MIGRAPHX_INLINE_NS { ...@@ -18,7 +18,8 @@ inline namespace MIGRAPHX_INLINE_NS {
instruction_ref convert_fp32_fp16(program& prog, instruction_ref& ins) instruction_ref convert_fp32_fp16(program& prog, instruction_ref& ins)
{ {
assert(ins->get_shape().type() == shape::float_type || ins->get_shape().type() == shape::double_type); assert(ins->get_shape().type() == shape::float_type ||
ins->get_shape().type() == shape::double_type);
assert(contains({"@literal", "@param"}, ins->name())); assert(contains({"@literal", "@param"}, ins->name()));
instruction_ref ins_fp16{}; instruction_ref ins_fp16{};
if(ins->name() == "@literal") if(ins->name() == "@literal")
...@@ -46,16 +47,16 @@ instruction_ref convert_fp32_fp16(program& prog, instruction_ref& ins) ...@@ -46,16 +47,16 @@ instruction_ref convert_fp32_fp16(program& prog, instruction_ref& ins)
void quantize(program& prog) void quantize(program& prog)
{ {
bool reduced_precision = false; bool reduced_precision = false;
shape::type_t orig_type = shape::float_type; shape::type_t orig_type = shape::float_type;
for(auto ins : iterator_for(prog)) for(auto ins : iterator_for(prog))
{ {
// convert float_type to half_type // convert float_type to half_type
if(contains({"@literal", "@param"}, ins->name()) && if(contains({"@literal", "@param"}, ins->name()) &&
(ins->get_shape().type() == shape::float_type || (ins->get_shape().type() == shape::float_type ||
ins->get_shape().type() == shape::double_type)) ins->get_shape().type() == shape::double_type))
{ {
orig_type = ins->get_shape().type(); orig_type = ins->get_shape().type();
auto ins_fp16 = convert_fp32_fp16(prog, ins); auto ins_fp16 = convert_fp32_fp16(prog, ins);
auto outputs = ins->outputs(); auto outputs = ins->outputs();
for(auto output : outputs) for(auto output : outputs)
......
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