Commit 3003844f authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 0905762b
......@@ -27,21 +27,21 @@ struct reduce_mean
std::vector<int64_t> tune_axes(std::size_t n_dim) const
{
auto tuned_axes = axes;
if (tuned_axes.empty())
if(tuned_axes.empty())
{
tuned_axes.resize(n_dim);
std::iota(tuned_axes.begin(), tuned_axes.end(), 0);
}
else
{
for (std::size_t i = 0; i < tuned_axes.size(); ++i)
for(std::size_t i = 0; i < tuned_axes.size(); ++i)
{
int64_t s_dim = static_cast<int64_t>(n_dim);
if (tuned_axes[i] >= s_dim or tuned_axes[i] < -s_dim)
if(tuned_axes[i] >= s_dim or tuned_axes[i] < -s_dim)
{
MIGRAPHX_THROW("REDUCE_MEAN: axis out of range");
}
if (tuned_axes[i] < 0)
if(tuned_axes[i] < 0)
{
tuned_axes[i] += n_dim;
}
......
......@@ -27,21 +27,21 @@ struct reduce_sum
std::vector<int64_t> tune_axes(std::size_t n_dim) const
{
auto tuned_axes = axes;
if (tuned_axes.empty())
if(tuned_axes.empty())
{
tuned_axes.resize(n_dim);
std::iota(tuned_axes.begin(), tuned_axes.end(), 0);
}
else
{
for (std::size_t i = 0; i < tuned_axes.size(); ++i)
for(std::size_t i = 0; i < tuned_axes.size(); ++i)
{
int64_t s_dim = static_cast<int64_t>(n_dim);
if (tuned_axes[i] >= s_dim or tuned_axes[i] < -s_dim)
if(tuned_axes[i] >= s_dim or tuned_axes[i] < -s_dim)
{
MIGRAPHX_THROW("REDUCE_SUM: axis out of range");
}
if (tuned_axes[i] < 0)
if(tuned_axes[i] < 0)
{
tuned_axes[i] += n_dim;
}
......
......@@ -472,7 +472,8 @@ void test_reduce_ops()
{
migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
expect_shape(migraphx::shape{migraphx::shape::float_type, {1, 1, 1, 1}}, T{{0, 1, 2, 3}}, input);
expect_shape(
migraphx::shape{migraphx::shape::float_type, {1, 1, 1, 1}}, T{{0, 1, 2, 3}}, input);
}
{
migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
......
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