Zero out the parameters of a module and return it.
(module)
| 50 | |
| 51 | |
| 52 | def zero_module(module): |
| 53 | """ |
| 54 | Zero out the parameters of a module and return it. |
| 55 | """ |
| 56 | for p in module.parameters(): |
| 57 | p.detach().zero_() |
| 58 | return module |
| 59 | |
| 60 | |
| 61 | class FFN(nn.Module): |