Zero out the parameters of a module and return it.
(module)
| 16 | |
| 17 | |
| 18 | def zero_module(module): |
| 19 | """ |
| 20 | Zero out the parameters of a module and return it. |
| 21 | """ |
| 22 | for p in module.parameters(): |
| 23 | p.detach().zero_() |
| 24 | return module |
| 25 | |
| 26 | def scale_module(module, scale): |
| 27 | """ |