Skip to content

Commit

Permalink
Try add eval() to speedup the eigen performance. (#48855)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xreki authored Dec 8, 2022
1 parent d3e9e73 commit e89a50c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paddle/phi/kernels/impl/logsumexp_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct LogsumexpFunctor {

auto x_mt = (*x).template cast<MT>();
auto y_dim = y->dimensions();
auto x_max = x_mt.maximum(dim);
auto x_max = x_mt.maximum(dim).eval();
y->device(place) =
(x_max +
(x_mt - x_max.reshape(t_dim).broadcast(r_dim)).exp().sum(dim).log())
Expand Down

0 comments on commit e89a50c

Please sign in to comment.