Update to using mypy 1.15 (#154054)

The BC break isn't real - mypy decided to start complaining about the way we were typing that function.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/154054
Approved by: https://github.com/Skylion007
This commit is contained in:
Aaron Orenstein
2025-05-23 17:59:48 -07:00
committed by PyTorch MergeBot
parent 76ed9db468
commit 6503b4a96e
11 changed files with 55 additions and 35 deletions

View File

@ -3747,14 +3747,14 @@ class TestCase(expecttest.TestCase):
if target is None:
target = batch_data[layout] = (ext_coo_indices1, d[1])
else:
target[0].set_(torch.cat((target[0], ext_coo_indices1), 1))
target[0].set_(torch.cat((target[0], ext_coo_indices1), 1)) # type: ignore[call-overload]
target[1].set_(torch.cat((target[1], d[1])))
else:
if target is None:
target = batch_data[layout] = tuple(d[j].unsqueeze(0) for j in range(len(d)))
else:
for j in range(len(d)):
target[j].set_(torch.cat((target[j], d[j].unsqueeze(0))))
target[j].set_(torch.cat((target[j], d[j].unsqueeze(0)))) # type: ignore[call-overload]
return batch_data
def generate_values(base, densesize):