karl
commited on
Commit
·
3e84e1e
1
Parent(s):
59b00ec
store weights too
Browse files- run_test.py +3 -0
run_test.py
CHANGED
@@ -50,6 +50,9 @@ def hook(module, inputs, outputs):
|
|
50 |
for idx, output in enumerate(outputs):
|
51 |
if isinstance(output, torch.Tensor):
|
52 |
store_tensor(f'{name}.output.{idx}', output);
|
|
|
|
|
|
|
53 |
IDX += 1
|
54 |
|
55 |
for module in pipe.model.modules():
|
|
|
50 |
for idx, output in enumerate(outputs):
|
51 |
if isinstance(output, torch.Tensor):
|
52 |
store_tensor(f'{name}.output.{idx}', output);
|
53 |
+
if not list(module.children())
|
54 |
+
for wtname, wt in list(module.named_parameters()) + list(module.named_buffers()):
|
55 |
+
store_tensor(f'{name}.{wtname}', wt)
|
56 |
IDX += 1
|
57 |
|
58 |
for module in pipe.model.modules():
|