mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[docs] Remove .data from some docs (#65358)
Summary: Related to https://github.com/pytorch/pytorch/issues/30987. Fix the following task: - [ ] Remove the use of `.data` in all our internal code: - [ ] ... - [x] `docs/source/scripts/build_activation_images.py` and `docs/source/notes/extending.rst` In `docs/source/scripts/build_activation_images.py`, I used `nn.init` because the snippet already assumes `nn` is available (the class inherits from `nn.Module`). cc albanD Pull Request resolved: https://github.com/pytorch/pytorch/pull/65358 Reviewed By: malfet Differential Revision: D31061790 Pulled By: albanD fbshipit-source-id: be936c2035f0bdd49986351026fe3e932a5b4032
This commit is contained in:
committed by
Facebook GitHub Bot
parent
daa50f1e9f
commit
f0ada4bd54
@ -58,7 +58,7 @@ def plot_function(function, **args):
|
||||
xrange = torch.arange(-7.0, 7.0, 0.01) # We need to go beyond 6 for ReLU6
|
||||
pylab.plot(
|
||||
xrange.numpy(),
|
||||
function(torch.autograd.Variable(xrange)).data.numpy(),
|
||||
function(xrange).detach().numpy(),
|
||||
**args
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user