torch.autograd.function.FunctionCtx.set_materialize_grads
- FunctionCtx.set_materialize_grads(value)
Set whether to materialize grad tensors. Default is
True.This should be called only from either the
setup_context()orforward()methods.If
True, undefined grad tensors will be expanded to tensors full of zeros prior to calling the and methods.