Commit 5b41beb8 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 860208db
......@@ -189,7 +189,7 @@ struct onnx_parser
s1.begin() + offset,
out_lens.begin() + offset,
[](auto a, auto b) {
if (a != b and a != 1 and b != 1)
if(a != b and a != 1 and b != 1)
{
MIGRAPHX_THROW("COMPUTE_BROADCASTED_LEN: input shapes mismatch!");
}
......@@ -900,13 +900,15 @@ struct onnx_parser
}
}
instruction_ref parse_constant_of_shape(const std::string&, attribute_map attributes, std::vector<instruction_ref> args)
instruction_ref parse_constant_of_shape(const std::string&,
attribute_map attributes,
std::vector<instruction_ref> args)
{
literal l_val{};
if (contains(attributes, "value"))
if(contains(attributes, "value"))
{
l_val = parse_value(attributes.at("value"));
if (l_val.get_shape().elements() != 1)
if(l_val.get_shape().elements() != 1)
{
MIGRAPHX_THROW("ConstantOfShape: attribute value can contain only 1 elements!");
}
......@@ -918,7 +920,7 @@ struct onnx_parser
// input is empty, output is a scalar
auto type = l_val.get_shape().type();
if (args.size() == 0)
if(args.size() == 0)
{
return prog.add_literal(literal({type, {1}, {0}}, l_val.data()));
}
......@@ -946,7 +948,8 @@ struct onnx_parser
}
}
instruction_ref parse_expand(const std::string&, attribute_map, std::vector<instruction_ref> args)
instruction_ref
parse_expand(const std::string&, attribute_map, std::vector<instruction_ref> args)
{
auto in_lens = args[0]->get_shape().lens();
auto ex_lens = args[1]->get_shape().lens();
......@@ -1377,9 +1380,10 @@ struct onnx_parser
}
}
instruction_ref parse_cast(const std::string&, attribute_map attributes, std::vector<instruction_ref> args)
instruction_ref
parse_cast(const std::string&, attribute_map attributes, std::vector<instruction_ref> args)
{
if (!contains(attributes, "to"))
if(!contains(attributes, "to"))
{
MIGRAPHX_THROW("PARSE_CAST: missing to type attribute!");
}
......
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