mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix unused Python variables in test/[e-z]* (#136964)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/136964 Approved by: https://github.com/justinchuby, https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
d298bd840f
commit
d8c8ba2440
@ -576,7 +576,7 @@ class TestAutocast(JitTestCase):
|
||||
cuda_o = torch.mm(cuda0, cuda1)
|
||||
return cpu_o, cuda_o
|
||||
|
||||
jit_t = torch.jit.script(t)
|
||||
torch.jit.script(t)
|
||||
cpu0 = torch.randn(5, 5, device="cpu", dtype=torch.float32)
|
||||
cpu1 = torch.randn(5, 5, device="cpu", dtype=torch.float32)
|
||||
cuda0 = torch.randn(5, 5, device="cuda", dtype=torch.float32)
|
||||
@ -591,7 +591,7 @@ class TestAutocast(JitTestCase):
|
||||
cuda_o = torch.mm(cuda0, cuda1)
|
||||
return cpu_o, cuda_o
|
||||
|
||||
jit_t = torch.jit.script(t)
|
||||
torch.jit.script(t)
|
||||
cpu0 = torch.randn(5, 5, device="cpu", dtype=torch.float32)
|
||||
cpu1 = torch.randn(5, 5, device="cpu", dtype=torch.float32)
|
||||
cuda0 = torch.randn(5, 5, device="cuda", dtype=torch.float32)
|
||||
@ -621,7 +621,7 @@ class TestAutocast(JitTestCase):
|
||||
t1 = torch.randn(5, 5, device="cuda", dtype=torch.float32).requires_grad_()
|
||||
|
||||
# run optimization
|
||||
for i in range(5):
|
||||
for _ in range(5):
|
||||
with torch.autocast("cuda", torch.float16):
|
||||
jit_o = jit_t(t0, t1)
|
||||
jit_o.sum().backward()
|
||||
|
Reference in New Issue
Block a user