Skip to content

Commit 4761d35

Browse files
committed
Make the compression optional, as it slows down.
1 parent ee69971 commit 4761d35

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

DeepFried2/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ def count_params(module):
2626
return sum(p.get_value().size for p in params)
2727

2828

29-
def save_params(module, where):
29+
def save_params(module, where, compress=False):
3030
params, _ = module.parameters()
31-
_np.savez_compressed(where, params=[p.get_value() for p in params])
31+
32+
savefn = _np.savez_compressed if compress else _np.savez
33+
savefn(where, params=[p.get_value() for p in params])
3234

3335

3436
def load_params(module, fromwhere):

0 commit comments

Comments
 (0)