torch.autograd.FunctionCtx
class FunctionCtxsaved_tensors(Tensor[])- – Tensors saved for backward computation. Access these in backward() after calling save_for_backward() in forward().
needs_input_grad(boolean[])- – Boolean tuple indicating which inputs require gradient. Set automatically based on input tensors' requires_grad.
Context object passed to forward and backward methods.
Use this to save tensors needed for backward computation and to query which inputs require gradients.