Scale the parameters of a module and return it.
(module, scale)
| 42 | |
| 43 | |
| 44 | def scale_module(module, scale): |
| 45 | """ |
| 46 | Scale the parameters of a module and return it. |
| 47 | """ |
| 48 | for p in module.parameters(): |
| 49 | p.detach().mul_(scale) |
| 50 | return module |
| 51 | |
| 52 | |
| 53 | def modulate(x, shift, scale): |