未验证 提交 07ede118 编写于 作者: A Aganlengzi 提交者: GitHub

[NPU] fix reduce_max (#43230)

上级 3adeea60
...@@ -141,6 +141,9 @@ class ReduceMaxGradNPUKernel : public framework::OpKernel<T> { ...@@ -141,6 +141,9 @@ class ReduceMaxGradNPUKernel : public framework::OpKernel<T> {
Tensor tmp_out, tmp_out_grad; Tensor tmp_out, tmp_out_grad;
auto tmp_out_dims_vec = x_dims_vec; auto tmp_out_dims_vec = x_dims_vec;
for (auto d : reduce_dims) { for (auto d : reduce_dims) {
if (d < 0) {
d += x_dims_vec.size();
}
tmp_out_dims_vec[d] = 1; tmp_out_dims_vec[d] = 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册