Revert "Remove unused Python variables in torch/[_-a]* (#133492)"

This reverts commit fda975a7b3071a20dab8fc2c4e453479e1bb7cf2.

Reverted https://github.com/pytorch/pytorch/pull/133492 on behalf of https://github.com/clee2000 due to Sorry, I need to revert this in order to revert something else.  The only thing you need to do is rebase and remerge ([comment](https://github.com/pytorch/pytorch/pull/133492#issuecomment-2536635516))
This commit is contained in:
PyTorch MergeBot
2024-12-11 17:29:10 +00:00
parent db51308d9c
commit 5c97ac9721
143 changed files with 457 additions and 275 deletions

View File

@ -900,7 +900,7 @@ class LOBPCG:
if self.ivars["istep"] == 0:
Ri = self._get_rayleigh_ritz_transform(self.X)
M = _utils.qform(_utils.qform(self.A, self.X), Ri)
_E, Z = _utils.symeig(M, largest)
E, Z = _utils.symeig(M, largest)
self.X = mm(self.X, mm(Ri, Z))
self.update_residual()
np = 0
@ -978,6 +978,7 @@ class LOBPCG:
"""
B = self.B
mm = torch.matmul
SBS = _utils.qform(B, S)
d_row = SBS.diagonal(0, -2, -1) ** -0.5
d_col = d_row.reshape(d_row.shape[0], 1)
@ -1096,6 +1097,7 @@ class LOBPCG:
BU = mm_B(self.B, U)
VBU = mm(V.mT, BU)
i = j = 0
stats = ""
for i in range(i_max):
U = U - mm(V, VBU)
drop = False