Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
cyber-pioneer committed Mar 12, 2023
1 parent 18c5373 commit 9c3ddeb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ void batch_norm_grad(const Tensor& x,

auto tmp = out_grad_data * x_sub_mean * rsqrt_var * rsqrt_var / nhw;
auto mean_temp2 = sum<T>(tmp, reduce_axis, dtype, false);
auto part2 = nhwc_out_grad - mean_temp1 - x_sub_mean * mean_temp2;
auto part2 = out_grad - mean_temp1 - x_sub_mean * mean_temp2;

auto x_grad_data = part1 * part2;
if (x.dtype() == phi::DataType::FLOAT16) {
Expand Down

0 comments on commit 9c3ddeb

Please sign in to comment.