Zero out the parameters of a module and return it.
(module)
| 3 | |
| 4 | |
| 5 | def zero_module(module): |
| 6 | """ |
| 7 | Zero out the parameters of a module and return it. |
| 8 | """ |
| 9 | for p in module.parameters(): |
| 10 | p.detach().zero_() |
| 11 | return module |
| 12 | |
| 13 | |
| 14 | class StylizationBlock(nn.Module): |