From 2b329d3bf1a23cef96e2ffd1cd45f542a95daf5f Mon Sep 17 00:00:00 2001 From: chilli Date: Tue, 1 Oct 2024 16:07:54 -0700 Subject: [PATCH] Fix typo in _normalize ref (#137079) I think this should basically make no difference numerically, but it does have some ramifications on things like CSE. Pull Request resolved: https://github.com/pytorch/pytorch/pull/137079 Approved by: https://github.com/Skylion007 ghstack dependencies: #136826, #137043, #137049, #137065 --- torch/_refs/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torch/_refs/__init__.py b/torch/_refs/__init__.py index 443026be298..8ac7df248a1 100644 --- a/torch/_refs/__init__.py +++ b/torch/_refs/__init__.py @@ -3140,7 +3140,7 @@ def _normalize( a_acc, dim=norm_dims, unbiased=False, keepdim=True ) rstd = torch.rsqrt(biased_var + eps) - out = (a - mean) * rstd + out = (a_acc - mean) * rstd return out, mean, rstd