We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ade78b commit 1fd2499Copy full SHA for 1fd2499
DeepFried2/utils.py
@@ -41,6 +41,12 @@ def count_params(module, learnable_only=True):
41
return sum(p.get_value().size for p in module.parameters(learnable_only=learnable_only))
42
43
44
+def reinit(module):
45
+ for p in module.parameters():
46
+ p.reinit()
47
+ return module
48
+
49
50
def flatten(what, types=(list, tuple), none_to_empty=False):
51
if what is None and none_to_empty:
52
return []
0 commit comments