fix context mgr for closure and grad

This commit is contained in:
Less Wright
2021-05-10 22:24:18 -07:00
parent de331ad196
commit a7edd418b1
+1 -1
View File
@@ -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