mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[4/N] Apply py39 ruff and pyupgrade fixes (#143257)
```torch/fx/passes/annotate_getitem_nodes.py``` was changed to support the new type hinting annotations. Pull Request resolved: https://github.com/pytorch/pytorch/pull/143257 Approved by: https://github.com/justinchuby, https://github.com/albanD
This commit is contained in:
@ -278,7 +278,7 @@ class TestNumPyInterop(TestCase):
|
||||
def test_from_numpy_no_leak_on_invalid_dtype(self):
|
||||
# This used to leak memory as the `from_numpy` call raised an exception and didn't decref the temporary
|
||||
# object. See https://github.com/pytorch/pytorch/issues/121138
|
||||
x = np.array("value".encode("ascii"))
|
||||
x = np.array(b"value")
|
||||
for _ in range(1000):
|
||||
try:
|
||||
torch.from_numpy(x)
|
||||
|
Reference in New Issue
Block a user