mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
committed by
PyTorch MergeBot
parent
40e27fbcf2
commit
99dbc5b0e2
@ -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):
|
||||
|
Reference in New Issue
Block a user