Skip to content

Commit 1c6f5aa

Browse files
authored
Reduce peak memory usage when freezing parameters. (#14)
1 parent 61c76ea commit 1c6f5aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

big_vision/optax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def create_schedule(mult=1.0, **kw):
6868
# Removes weight decay updates. Note that weight decay already has an
6969
# independent mask (which cannot be combined easily with a second mask),
7070
# so instead we multiply updates for frozen params with zero.
71-
optax.masked(optax.scale(0.0), frozen_mask)
71+
optax.masked(optax.set_to_zero(), frozen_mask)
7272
]
7373

7474
# Gradient clipping.

0 commit comments

Comments
 (0)