Scale the parameters of a module and return it.
(module, scale)
| 157 | |
| 158 | |
| 159 | def scale_module(module, scale): |
| 160 | """ |
| 161 | Scale the parameters of a module and return it. |
| 162 | """ |
| 163 | for p in module.parameters(): |
| 164 | p.detach().mul_(scale) |
| 165 | return module |
| 166 | |
| 167 | |
| 168 | def mean_flat(tensor): |
nothing calls this directly
no test coverage detected