Lines Matching full:backward
49 # Scales loss. Calls backward() on scaled loss to create scaled gradients.
50 # Backward passes under autocast are not recommended.
51 # Backward ops run in the same dtype autocast chose for corresponding forward ops.
52 scaler.scale(loss).backward()
67 All gradients produced by ``scaler.scale(loss).backward()`` are scaled. If you wish to modify or i…
68 the parameters' ``.grad`` attributes between ``backward()`` and ``scaler.step(optimizer)``, you sh…
93 scaler.scale(loss).backward()
131 the next backward pass will add scaled grads to unscaled grads (or grads scaled by a different fact…
149 scaler.scale(loss).backward()
187 loss.backward()
212 # Scales the loss for autograd.grad's backward pass, producing scaled_grad_params
230 # Applies scaling to the backward call as usual.
232 scaler.scale(loss).backward()
266 # example, both backward() calls share some sections of graph.)
267 scaler.scale(loss0).backward(retain_graph=True)
268 scaler.scale(loss1).backward()
357 ``backward`` respectively. These ensure ``forward`` executes with the current autocast state and `…
368 def backward(ctx, grad):
384 and :func:`custom_bwd(device_type='cuda')<custom_bwd>` to ``backward``.
387 `CUDA` in this example, and locally disable autocast during ``forward`` and ``backward``::
398 def backward(ctx, grad):