mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Deprecate torch._utils.is_compiling()
and torch._dynamo.external_utils.is_compiling()
(#127690)
This PR is split from PR #126898. - #126898 ------ Pull Request resolved: https://github.com/pytorch/pytorch/pull/127690 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
917387f66d
commit
348b181a97
@ -287,7 +287,7 @@ class TestOptimRenewed(TestCase):
|
||||
inpt = torch.randn(5, device=device, dtype=dtype)
|
||||
|
||||
# avoid endless recompiles by wrapping LR in a tensor if we're compiling
|
||||
lr = torch.tensor(0.01) if torch._utils.is_compiling() else 0.01
|
||||
lr = torch.tensor(0.01) if torch.compiler.is_compiling() else 0.01
|
||||
optimizer = optim_cls([{"params": [weight]}, {"params": [bias], "lr": lr}])
|
||||
schedulers = [scheduler_c(optimizer) for scheduler_c in schedulers_c]
|
||||
|
||||
|
Reference in New Issue
Block a user