More stable computation of KL between two Bernoulli distributions (#79944)
Fixes #20164
@neerajprad here the new PR with the updated master
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79944
Approved by: https://github.com/neerajprad