pytorch/docs/source/notes
Richard Zou 5d628db0a2 Deprecate ctx.saved_variables via python warning. (#5923)
* Deprecate ctx.saved_variables via python warning.

Advises replacing saved_variables with saved_tensors.
Also replaces all instances of ctx.saved_variables with ctx.saved_tensors in the
codebase.

Test by running:
```
import torch
from torch.autograd import Function

class MyFunction(Function):
    @staticmethod
    def forward(ctx, tensor1, tensor2):
        ctx.save_for_backward(tensor1, tensor2)
        return tensor1 + tensor2

    @staticmethod
    def backward(ctx, grad_output):
        var1, var2 = ctx.saved_variables
        return (grad_output, grad_output)

x = torch.randn((3, 3), requires_grad=True)
y = torch.randn((3, 3), requires_grad=True)
model = MyFunction()
model.apply(x, y).sum().backward()
```
and assert the warning shows up.

* Address comments

* Add deprecation test for saved_variables
2018-03-26 14:13:45 -04:00
..
autograd.rst Remove deprecated references to volatile (#5193) 2018-02-12 21:08:27 +01:00
broadcasting.rst fix docs for broadcast warning 2017-06-26 14:50:57 -04:00
cuda.rst add faq on cuda memory management and dataloder (#5378) 2018-02-27 18:35:30 -05:00
extending.rst Deprecate ctx.saved_variables via python warning. (#5923) 2018-03-26 14:13:45 -04:00
faq.rst typo (#5847) 2018-03-17 10:26:00 -04:00
multiprocessing.rst updated the documentation to remove the unnecessary copy grads when using multiprocessing 2017-03-13 19:04:17 -04:00
serialization.rst code syntax error in document (serialization.rst) (#937) 2017-03-06 10:06:04 -05:00