PEP585 update - test (#145176)

See #145101 for details.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/145176
Approved by: https://github.com/bobrenjc93
This commit is contained in:
Aaron Orenstein
2025-01-21 11:22:20 -08:00
committed by PyTorch MergeBot
parent 40e27fbcf2
commit 99dbc5b0e2
146 changed files with 801 additions and 1099 deletions

View File

@ -2,7 +2,7 @@
import torch
from torch.cuda.amp import autocast
from typing import Optional, Tuple
from typing import Optional
import unittest
from test_jit import JitTestCase
@ -923,7 +923,7 @@ class TestJitTraceAutocast(JitTestCase):
def test_script_autocast_enable_and_check(self):
def fn(x, y) -> Tuple[torch.Tensor, bool, torch.Tensor, bool, torch.Tensor, bool]:
def fn(x, y) -> tuple[torch.Tensor, bool, torch.Tensor, bool, torch.Tensor, bool]:
b1 = torch.is_autocast_cpu_enabled()
v1 = torch.mm(x, y)
with torch.autocast(device_type="cpu", enabled=True):