(*unused)
| 164 | |
| 165 | # Hook used for back-prop. |
| 166 | def param_hook(*unused): |
| 167 | # Add the gradient to the buffer. |
| 168 | if param.grad.data is not None: |
| 169 | param.main_grad.add_(param.grad.data) |
| 170 | # Now we can deallocate grad memory. |
| 171 | param.grad = None |
| 172 | |
| 173 | return param_hook |
| 174 |
nothing calls this directly
no outgoing calls
no test coverage detected