Commit ec54c989 authored by Khalique Ahmed's avatar Khalique Ahmed
Browse files

formatting

parent 8083e267
...@@ -56,9 +56,10 @@ struct parse_reshape : op_parser<parse_reshape> ...@@ -56,9 +56,10 @@ struct parse_reshape : op_parser<parse_reshape>
std::vector<size_t> orig_dims = args[0]->get_shape().lens(); std::vector<size_t> orig_dims = args[0]->get_shape().lens();
auto dims_acc = std::accumulate(dims.begin(), dims.end(), 1, std::multiplies<int64_t>()); auto dims_acc = std::accumulate(dims.begin(), dims.end(), 1, std::multiplies<int64_t>());
auto orig_dims_acc = std::accumulate(orig_dims.begin(), orig_dims.end(), 1, std::multiplies<int64_t>()); auto orig_dims_acc =
std::accumulate(orig_dims.begin(), orig_dims.end(), 1, std::multiplies<int64_t>());
if (std::abs(dims_acc) == orig_dims_acc) if(std::abs(dims_acc) == orig_dims_acc)
return info.add_instruction(make_op("reshape", {{"dims", dims}}), return info.add_instruction(make_op("reshape", {{"dims", dims}}),
info.make_contiguous(args[0])); info.make_contiguous(args[0]));
if(parser.default_dim_value * std::abs(dims_acc) == orig_dims_acc) if(parser.default_dim_value * std::abs(dims_acc) == orig_dims_acc)
...@@ -67,7 +68,8 @@ struct parse_reshape : op_parser<parse_reshape> ...@@ -67,7 +68,8 @@ struct parse_reshape : op_parser<parse_reshape>
return info.add_instruction(make_op("reshape", {{"dims", dims}}), return info.add_instruction(make_op("reshape", {{"dims", dims}}),
info.make_contiguous(args[0])); info.make_contiguous(args[0]));
} }
MIGRAPHX_THROW("Reshape: incorrect number of elements: " + std::to_string(dims_acc) + " versus " + std::to_string(orig_dims_acc)); MIGRAPHX_THROW("Reshape: incorrect number of elements: " + std::to_string(dims_acc) +
" versus " + std::to_string(orig_dims_acc));
} }
}; };
......
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