mirror of
https://github.com/wassname/Ranger21.git
synced 2026-09-09 11:15:43 +08:00
fix context mgr for closure and grad
This commit is contained in:
@@ -512,7 +512,7 @@ class Ranger21(TO.Optimizer):
|
||||
|
||||
loss = None
|
||||
if closure is not None and isinstance(closure, collections.Callable):
|
||||
with torch.grad():
|
||||
with torch.enable_grad():
|
||||
loss = closure()
|
||||
|
||||
param_size = 0
|
||||
|
||||
Reference in New Issue
Block a user