Zero out the parameters of a module and return it.
(module)
| 103 | |
| 104 | |
| 105 | def zero_module(module): |
| 106 | """ |
| 107 | Zero out the parameters of a module and return it. |
| 108 | """ |
| 109 | for p in module.parameters(): |
| 110 | p.detach().zero_() |
| 111 | return module |
| 112 | |
| 113 | |
| 114 | def Normalize(in_channels): |