Skip to content

Commit 808ee73

Browse files
committed
update: LARS
1 parent fa05118 commit 808ee73

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pytorch_optimizer/lars.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def step(self, closure: CLOSURE = None) -> LOSS:
7171
if p.grad is None:
7272
continue
7373

74+
if p.grad.data.is_sparse:
75+
raise RuntimeError('LARS does not support sparse gradients')
76+
7477
dp = p.grad
7578

7679
if p.ndim > 1: # if not normalization gamma/beta or bias

0 commit comments

Comments
 (0)