Zero out the parameters of a module and return it.
(module)
| 97 | |
| 98 | |
| 99 | def zero_module(module): |
| 100 | """ |
| 101 | Zero out the parameters of a module and return it. |
| 102 | """ |
| 103 | for p in module.parameters(): |
| 104 | p.detach().zero_() |
| 105 | return module |
| 106 | |
| 107 | |
| 108 | class ResnetBlock(nn.Module): |