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

Merge branch 'reduce_mean' of https://github.com/ROCmSoftwarePlatform/AMDMIGraphX into test_bert

parents 751e8f37 e61be020
...@@ -34,16 +34,16 @@ struct reduce_mean ...@@ -34,16 +34,16 @@ struct reduce_mean
} }
else else
{ {
for(std::size_t i = 0; i < tuned_axes.size(); ++i) for(auto& axis : tuned_axes)
{ {
int64_t s_dim = static_cast<int64_t>(n_dim); int64_t s_dim = static_cast<int64_t>(n_dim);
if(tuned_axes[i] >= s_dim or tuned_axes[i] < -s_dim) if(axis >= s_dim or axis < -s_dim)
{ {
MIGRAPHX_THROW("REDUCE_MEAN: axis out of range"); MIGRAPHX_THROW("REDUCE_MEAN: axis out of range");
} }
if(tuned_axes[i] < 0) if(axis < 0)
{ {
tuned_axes[i] += n_dim; axis += n_dim;
} }
} }
} }
......
...@@ -34,16 +34,16 @@ struct reduce_sum ...@@ -34,16 +34,16 @@ struct reduce_sum
} }
else else
{ {
for(std::size_t i = 0; i < tuned_axes.size(); ++i) for(auto& axis : tuned_axes)
{ {
int64_t s_dim = static_cast<int64_t>(n_dim); int64_t s_dim = static_cast<int64_t>(n_dim);
if(tuned_axes[i] >= s_dim or tuned_axes[i] < -s_dim) if(axis >= s_dim or axis < -s_dim)
{ {
MIGRAPHX_THROW("REDUCE_SUM: axis out of range"); MIGRAPHX_THROW("REDUCE_MEAN: axis out of range");
} }
if(tuned_axes[i] < 0) if(axis < 0)
{ {
tuned_axes[i] += n_dim; axis += n_dim;
} }
} }
} }
......
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