summaryrefslogtreecommitdiff
path: root/docs/source/onnx.rst
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@fb.com>2017-09-05 21:06:30 -0700
committerAdam Paszke <adam.paszke@gmail.com>2017-09-06 21:35:50 -0400
commitfbb8f13499e43f1fbf4557c7a73e708646ac8e55 (patch)
treeed606eb2cd8c4e7add0f0c5ea6d55d6ce02fdef8 /docs/source/onnx.rst
parenta2e5224847aa63b598e76aa749d3721234910d27 (diff)
downloadpytorch-fbb8f13499e43f1fbf4557c7a73e708646ac8e55.tar.gz
pytorch-fbb8f13499e43f1fbf4557c7a73e708646ac8e55.tar.bz2
pytorch-fbb8f13499e43f1fbf4557c7a73e708646ac8e55.zip
Docs now finally run with ToffeeIR master.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Diffstat (limited to 'docs/source/onnx.rst')
-rw-r--r--docs/source/onnx.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/docs/source/onnx.rst b/docs/source/onnx.rst
index c122924200..86f6c2f3b3 100644
--- a/docs/source/onnx.rst
+++ b/docs/source/onnx.rst
@@ -68,15 +68,17 @@ To run the exported script with Caffe2, you will need to install
the backend for Caffe2::
# ...continuing from above
- import onnx.backend.c2 as backend
+ import onnx.backend.caffe2 as backend
import numpy as np
rep = backend.prepare(graph, device="CUDA:0") # or "CPU"
# For the Caffe2 backend:
# rep.predict_net is the Caffe2 protobuf for the network
# rep.workspace is the Caffe2 workspace for the network
- # (see the class toffee.backend.c2.Workspace)
- outputs = backend.run(rep, np.rand(10, 3, 224, 224))
+ # (see the class onnx.backend.c2.Workspace)
+ outputs = rep.run(np.random.randn(10, 3, 224, 224).astype(np.float32))
+ # To run networks with more than one input, pass a tuple
+ # rather than a single numpy ndarray.
print(outputs[0])
In the future, there will be backends for other frameworks as well.
@@ -124,6 +126,7 @@ In this tech preview, only the following operators are supported:
* Slice (only integer indexing is supported)
* Dropout (inplace is discarded)
* Relu (inplace is discarded)
+* PReLU (inplace is discarded, sharing a single weight among all channels is not supported)
* LeakyRelu (inplace is discarded)
* MaxPool1d (ceil_mode must be False)
* MaxPool2d (ceil_mode must be False
@@ -141,6 +144,7 @@ list. The operator set above is sufficient to export the following models:
* SqueezeNet
* SuperResolution
* VGG
+* `word_language_model <https://github.com/pytorch/examples/tree/master/word_language_model>`_
The interface for specifying operator definitions is highly experimental
and undocumented; adventurous users should note that the APIs will probably