Shortcuts

torch.autograd.function._ContextMethodMixin.set_materialize_grads

_ContextMethodMixin.set_materialize_grads(value)[source]

Sets whether to materialize output grad tensors. Default is true.

This should be called only from inside the forward() method

If true, undefined output grad tensors will be expanded to tensors full of zeros prior to calling the backward() method.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources