log_softmax (#3411)
Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/3411 Use the following property to implement `log_softmax` ``` log(exp(x_i) / sum(exp(x_j))) = x_i - log(sum(exp(x_j))) ``` - numerically stable, since we can avoid log(small_number) -> -\infty - reusing existing `softmax` shader to generate variants Reviewed By: yipjustin, SS-JIA Differential Revision: D56688093 fbshipit-source-id: bfc58103a0f09e305f6bf47e764f6d44519f75d4
W
Wei Lu committed
5b65163c37f77cd98073783745396dae847864d7
Parent: 2c1e283
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 5/8/2024, 2:50:16 AM