Zero out the parameters of a module and return it.
(module)
| 172 | |
| 173 | |
| 174 | def zero_module(module): |
| 175 | """ |
| 176 | Zero out the parameters of a module and return it. |
| 177 | """ |
| 178 | for p in module.parameters(): |
| 179 | p.detach().zero_() |
| 180 | return module |
| 181 | |
| 182 | |
| 183 | def scale_module(module, scale): |