Commit 30cde6df authored by Paul's avatar Paul
Browse files

Simplify calculation

parent fc9b2a7d
...@@ -63,11 +63,7 @@ struct concat_compiler : compiler<concat_compiler> ...@@ -63,11 +63,7 @@ struct concat_compiler : compiler<concat_compiler>
static std::size_t get_concat_elements(const std::vector<shape>& inputs) static std::size_t get_concat_elements(const std::vector<shape>& inputs)
{ {
auto total = return inputs.back().elements() / (inputs.size() - 1);
std::accumulate(inputs.begin(), std::prev(inputs.end()), 0, [](auto x, auto s) {
return x + s.elements();
});
return total / (inputs.size() - 1);
} }
operation compile_op(context& ctx, const std::vector<shape>& inputs, const value& v) const operation compile_op(context& ctx, const std::vector<shape>& inputs, const value& v) const
......
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