Skip to content

Commit

Permalink
[BugFix] Fix illegal memory overflow for p_norm op (PaddlePaddle#49537)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZHUI authored Jan 5, 2023
1 parent e8f4a32 commit ba1dce0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paddle/phi/infermeta/unary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2644,8 +2644,9 @@ void PNormInferMeta(const MetaTensor& x,
if (reduce_dims.size() == 0) {
reduce_dims.emplace_back(1);
}

x_dim[axis] = 1;
}
x_dim[axis] = 1;

if (keepdim) {
out->set_dims(x_dim);
Expand Down

0 comments on commit ba1dce0

Please sign in to comment.