Zero out the parameters of a module and return it.
(module)
| 66 | |
| 67 | |
| 68 | def zero_module(module): |
| 69 | """ |
| 70 | Zero out the parameters of a module and return it. |
| 71 | """ |
| 72 | for p in module.parameters(): |
| 73 | p.detach().zero_() |
| 74 | return module |
| 75 | |
| 76 | |
| 77 | def scale_module(module, scale): |