Commit 85b35f92 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 6cda085f
......@@ -260,19 +260,20 @@ struct onnx_parser
return prog.add_instruction(op, std::move(args));
}
// instruction_ref
// parse_softmax(const std::string&, const attribute_map&, std::vector<instruction_ref> args)
// {
// auto dims = args.front()->get_shape().lens();
// auto r =
// prog.add_instruction(op::reshape{{long(dims[0]), long(dims[1]), 1, 1}}, args.front());
// auto s = prog.add_instruction(op::softmax{}, r);
// return prog.add_instruction(op::reshape{{long(dims[0]), long(dims[1])}}, s);
// }
// instruction_ref
// parse_softmax(const std::string&, const attribute_map&, std::vector<instruction_ref> args)
// {
// auto dims = args.front()->get_shape().lens();
// auto r =
// prog.add_instruction(op::reshape{{long(dims[0]), long(dims[1]), 1, 1}},
// args.front());
// auto s = prog.add_instruction(op::softmax{}, r);
// return prog.add_instruction(op::reshape{{long(dims[0]), long(dims[1])}}, s);
// }
instruction_ref parse_softmax(const std::string&,
const attribute_map& attributes,
std::vector<instruction_ref> args)
const attribute_map& attributes,
std::vector<instruction_ref> args)
{
int axis = 1;
if(contains(attributes, "axis"))
......@@ -473,15 +474,16 @@ struct onnx_parser
op::reshape op;
if(args.size() == 1)
{
if (contains(attributes, "shape"))
if(contains(attributes, "shape"))
{
literal s = parse_value(attributes.at("shape"));
s.visit([&](auto v) { copy(v, std::back_inserter(op.dims)); });
}
else
{
MIGRAPHX_THROW("Parse_reshape: shape attribute is needed when only one argument is provided!");
}
MIGRAPHX_THROW(
"Parse_reshape: shape attribute is needed when only one argument is provided!");
}
}
if(args.size() == 2)
{
......@@ -491,7 +493,7 @@ struct onnx_parser
s.visit([&](auto v) { copy(v, std::back_inserter(op.dims)); });
}
if (!args[0]->get_shape().standard())
if(!args[0]->get_shape().standard())
{
args[0] = prog.add_instruction(op::contiguous{}, args[0]);
}
......
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