File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
(optional) Exporting a Model from PyTorch to ONNX and Running it using ONNX Runtime
3
- ========================================================================
3
+ ===================================================================================
4
4
5
5
.. Note::
6
6
As of PyTorch 2.1, there are two versions of ONNX Exporter.
23
23
and `ONNX Runtime <https://github.com/microsoft/onnxruntime>`__.
24
24
You can get binary builds of ONNX and ONNX Runtime with
25
25
26
- .. code-block:: bash
27
- %%bash
28
- pip install onnxruntime
26
+ .. code-block:: bash
27
+
28
+ %%bash
29
+ pip install onnxruntime
29
30
30
31
ONNX Runtime recommends using the latest stable runtime for PyTorch.
31
32
@@ -195,7 +196,7 @@ def _initialize_weights(self):
195
196
196
197
import onnxruntime
197
198
198
- ort_session = onnxruntime .InferenceSession ("super_resolution.onnx" , providers = [' CPUExecutionProvider' ])
199
+ ort_session = onnxruntime .InferenceSession ("super_resolution.onnx" , providers = [" CPUExecutionProvider" ])
199
200
200
201
def to_numpy (tensor ):
201
202
return tensor .detach ().cpu ().numpy () if tensor .requires_grad else tensor .cpu ().numpy ()
You can’t perform that action at this time.
0 commit comments