Commit 39422238 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

refine the quantization function

parent 1b8cb243
...@@ -101,14 +101,18 @@ void quantize(program& prog, const std::vector<std::string>& ins_names) ...@@ -101,14 +101,18 @@ void quantize(program& prog, const std::vector<std::string>& ins_names)
} }
else else
{ {
// check the dead code case to avoid assert
bool output_empty = ins->outputs().empty();
auto ins_orig_type = auto ins_orig_type =
prog.insert_instruction(std::next(ins), op::convert{orig_type}, ins); prog.insert_instruction(std::next(ins), op::convert{orig_type}, ins);
prog.replace_instruction(ins, ins_orig_type); if (!output_empty)
{
prog.replace_instruction(ins, ins_orig_type);
}
} }
} }
prog.replace_instruction(ins, op, converted_inputs); prog.replace_instruction(ins, op, converted_inputs);
// instruction::replace(ins, op, compute_shape(op, converted_inputs), converted_inputs);
} }
} }
} }
......
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