未验证 提交 f9c1cdc1 编写于 作者: L Leo Guo 提交者: GitHub

Fix the bug of PHI kernel of reduce_sum in kunlun when using eager mode. (#47004)

test=kunlun
上级 6566b8f5
......@@ -32,6 +32,9 @@ void ReduceSumGradKernel(const Context& dev_ctx,
dev_ctx.template Alloc<XPUType>(x_grad);
const auto* out_data = out_grad.data<XPUType>();
auto* x_grad_data = x_grad->data<XPUType>();
if (dims_arr.size() == 0) {
reduce_all = true;
}
const auto& input_dim_size = x.dims().size();
std::vector<int> true_dims;
for (size_t i = 0; i < dims.size(); ++i) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册