Commit 881665a8 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format'

parent 5447f39c
......@@ -300,11 +300,12 @@ void quantize_int8(program& prog,
// relative rounding error
else
{
auto q_dot = prog.insert_instruction(ins, op::quant_dot{1, 0}, converted_inputs);
auto f_dot = prog.insert_instruction(ins, op::convert{shape::float_type}, q_dot);
auto c_shape = q_dot->get_shape();
auto q_dot = prog.insert_instruction(ins, op::quant_dot{1, 0}, converted_inputs);
auto f_dot = prog.insert_instruction(ins, op::convert{shape::float_type}, q_dot);
auto c_shape = q_dot->get_shape();
std::vector<float> vec_alpha(c_shape.elements(), new_alpha);
auto l_alpha = prog.add_literal(literal({shape::float_type, c_shape.lens()}, vec_alpha));
auto l_alpha =
prog.add_literal(literal({shape::float_type, c_shape.lens()}, vec_alpha));
if(inputs.size() == 3 and dot_op.beta != 0.0f)
{
......@@ -325,7 +326,7 @@ void quantize_int8(program& prog,
beta_c = prog.insert_instruction(ins, op::mul{}, l_beta, inputs.back());
}
if (orig_type == shape::float_type)
if(orig_type == shape::float_type)
{
prog.replace_instruction(ins, op::add{}, alpha_ab, beta_c);
}
......@@ -333,18 +334,18 @@ void quantize_int8(program& prog,
{
auto f_res = prog.insert_instruction(ins, op::add{}, alpha_ab, beta_c);
prog.replace_instruction(ins, op::convert{orig_type}, f_res);
}
}
}
else
{
if (orig_type == shape::float_type)
if(orig_type == shape::float_type)
{
prog.replace_instruction(ins, op::mul{}, l_alpha, f_dot);
}
else
{
auto alpha_ab = prog.insert_instruction(ins, op::mul{}, l_alpha, f_dot);
prog.replace_instruction(ins, op::convert{orig_type}, alpha_ab);
prog.replace_instruction(ins, op::convert{orig_type}, alpha_ab);
}
}
}
......
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