(self, loss)
| 255 | return torch.cuda.amp.autocast() if self.activated else NullContextManager() |
| 256 | |
| 257 | def backward(self, loss): |
| 258 | if self.activated: |
| 259 | self.scaler.scale(loss).backward() |
| 260 | else: |
| 261 | loss.backward() |
| 262 | |
| 263 | def step(self, optimizer): |
| 264 | if self.activated: |
nothing calls this directly
no outgoing calls
no test coverage detected