Skip to content

Commit cc0793a

Browse files
narumirunaPenghuiCheng
authored andcommitted
Update onnx.rst for v0.4 (pytorch#10810)
Summary: Since we don't need `torch.autograd.Variable` anymore, I removed `torch.autograd.Variable` from `onnx.rst`. Pull Request resolved: pytorch#10810 Differential Revision: D9500960 Pulled By: zou3519 fbshipit-source-id: 1bc820734c96a8c7cb5d804e6d51a95018db8e7f
1 parent 661617e commit cc0793a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/source/onnx.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ Here is a simple script which exports a pretrained AlexNet as defined in
99
torchvision into ONNX. It runs a single round of inference and then
1010
saves the resulting traced model to ``alexnet.onnx``::
1111

12-
from torch.autograd import Variable
13-
import torch.onnx
12+
import torch
1413
import torchvision
1514

16-
dummy_input = Variable(torch.randn(10, 3, 224, 224)).cuda()
15+
dummy_input = torch.randn(10, 3, 224, 224, device='cuda')
1716
model = torchvision.models.alexnet(pretrained=True).cuda()
1817

1918
# Providing input and output names sets the display names for values

0 commit comments

Comments
 (0)