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

clang format

parent 4e673ca3
...@@ -24,17 +24,19 @@ instruction_ref convert_fp32_fp16(program& prog, instruction_ref& ins) ...@@ -24,17 +24,19 @@ instruction_ref convert_fp32_fp16(program& prog, instruction_ref& ins)
instruction_ref ins_fp16{}; instruction_ref ins_fp16{};
if(ins->name() == "@literal") if(ins->name() == "@literal")
{ {
shape s = ins->get_shape(); shape s = ins->get_shape();
auto l = ins->get_literal(); auto l = ins->get_literal();
if (s.type() == shape::float_type) if(s.type() == shape::float_type)
{ {
auto tv = l.get<const float>(); auto tv = l.get<const float>();
ins_fp16 = prog.add_literal(literal({shape::half_type, s.lens()}, tv.begin(), tv.end())); ins_fp16 =
prog.add_literal(literal({shape::half_type, s.lens()}, tv.begin(), tv.end()));
} }
else else
{ {
auto tv = l.get<const double>(); auto tv = l.get<const double>();
ins_fp16 = prog.add_literal(literal({shape::half_type, s.lens()}, tv.begin(), tv.end())); ins_fp16 =
prog.add_literal(literal({shape::half_type, s.lens()}, tv.begin(), tv.end()));
} }
} }
else if(ins->name() == "@param") else if(ins->name() == "@param")
......
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