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

clang format

parent d05cc61a
...@@ -16,19 +16,18 @@ shape miopen_logsoftmax::compute_shape(const std::vector<shape>& inputs) const ...@@ -16,19 +16,18 @@ shape miopen_logsoftmax::compute_shape(const std::vector<shape>& inputs) const
} }
argument miopen_logsoftmax::compute(context& ctx, argument miopen_logsoftmax::compute(context& ctx,
const shape& output_shape, const shape& output_shape,
const std::vector<argument>& args) const const std::vector<argument>& args) const
{ {
float alpha = 1; float alpha = 1;
float beta = 0; float beta = 0;
// temporarily reshape the input to a(0)...a(axis-1) // temporarily reshape the input to a(0)...a(axis-1)
// and a(axis)....a(n) // and a(axis)....a(n)
auto lens = output_shape.lens(); auto lens = output_shape.lens();
std::size_t batch_size = std::accumulate( std::size_t batch_size = std::accumulate(
lens.begin(), lens.begin() + op.axis, lens.begin(), lens.begin() + op.axis, std::size_t{1}, std::multiplies<std::size_t>());
std::size_t{1}, std::multiplies<std::size_t>()); std::size_t n_dims = std::accumulate(
std::size_t n_dims = std::accumulate(lens.begin() + op.axis, lens.begin() + op.axis, lens.end(), std::size_t{1}, std::multiplies<std::size_t>());
lens.end(), std::size_t{1}, std::multiplies<std::size_t>());
migraphx::shape comp_shape{output_shape.type(), {batch_size, n_dims, 1, 1}}; migraphx::shape comp_shape{output_shape.type(), {batch_size, n_dims, 1, 1}};
auto x_desc = make_tensor(args[0].get_shape()); auto x_desc = make_tensor(args[0].get_shape());
auto y_desc = make_tensor(output_shape); auto y_desc = make_tensor(output_shape);
......
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