Skip to content

Commit a473681

Browse files
authored
Merge branch 'master' into master
2 parents f986bab + 879845f commit a473681

18 files changed

+711
-745
lines changed

.jenkins/build.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ export PATH=/opt/conda/bin:$PATH
1515
rm -rf src
1616
pip install -r $DIR/../requirements.txt
1717

18+
# For Tensorboard. Until 1.14 moves to the release channel.
19+
pip install tb-nightly
20+
1821
export PATH=/opt/conda/bin:$PATH
1922
pip install sphinx==1.8.2 pandas
2023

@@ -30,10 +33,16 @@ pip install -e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch
3033
pip install sphinx-gallery==0.3.1 tqdm matplotlib ipython pillow==4.1.1
3134

3235
# Install torchaudio from source
33-
# git clone https://github.com/pytorch/audio --quiet
34-
# pushd audio
35-
# python setup.py install
36-
# popd
36+
git clone https://github.com/pytorch/audio --quiet
37+
pushd audio
38+
python setup.py install
39+
popd
40+
41+
# Install torchaudio from source
42+
git clone https://github.com/pytorch/text --quiet
43+
pushd text
44+
python setup.py install
45+
popd
3746

3847
aws configure set default.s3.multipart_threshold 5120MB
3948

@@ -185,4 +194,4 @@ else
185194
fi
186195

187196
rm -rf vision
188-
# rm -rf audio
197+
rm -rf audio

_static/imagenet_class_index.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

_static/img/cat_output1.png

-317 KB
Binary file not shown.
49.5 KB
Loading

_static/img/flask.png

173 KB
Loading

_static/img/sample_file.jpeg

43.3 KB
Loading

advanced_source/README.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ Advanced Tutorials
1313
Custom C Extensions for PyTorch
1414
https://pytorch.org/tutorials/advanced/c_extension.html
1515

16-
4. super_resolution_with_caffe2.py
17-
Transfering a Model from PyTorch to Caffe2 and Mobile using ONNX
18-
https://pytorch.org/tutorials/advanced/super_resolution_with_caffe2.html
16+
4. super_resolution_with_onnxruntime.py
17+
Exporting a Model from PyTorch to ONNX and Running it using ONNXRuntime
18+
https://pytorch.org/tutorials/advanced/super_resolution_with_onnxruntime.html

advanced_source/cpp_extension.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,22 @@ For the "ahead of time" flavor, we build our C++ extension by writing a
147147
``setup.py`` script that uses setuptools to compile our C++ code. For the LLTM, it
148148
looks as simple as this::
149149

150-
from setuptools import setup
151-
from torch.utils.cpp_extension import CppExtension, BuildExtension
150+
from setuptools import setup, Extension
151+
from torch.utils import cpp_extension
152152

153153
setup(name='lltm_cpp',
154-
ext_modules=[CppExtension('lltm', ['lltm.cpp'])],
155-
cmdclass={'build_ext': BuildExtension})
156-
154+
ext_modules=[cpp_extension.CppExtension('lltm_cpp', ['lltm.cpp'])],
155+
cmdclass={'build_ext': cpp_extension.BuildExtension})
157156

158157
In this code, :class:`CppExtension` is a convenience wrapper around
159158
:class:`setuptools.Extension` that passes the correct include paths and sets
160159
the language of the extension to C++. The equivalent vanilla :mod:`setuptools`
161160
code would simply be::
162161

163-
setuptools.Extension(
162+
Extension(
164163
name='lltm_cpp',
165164
sources=['lltm.cpp'],
166-
include_dirs=torch.utils.cpp_extension.include_paths(),
165+
include_dirs=cpp_extension.include_paths(),
167166
language='c++')
168167

169168
:class:`BuildExtension` performs a number of required configuration steps and
@@ -413,7 +412,7 @@ see::
413412
If we call ``help()`` on the function or module, we can see that its signature
414413
matches our C++ code::
415414

416-
In[4] help(lltm.forward)
415+
In[4] help(lltm_cpp.forward)
417416
forward(...) method of builtins.PyCapsule instance
418417
forward(arg0: torch::Tensor, arg1: torch::Tensor, arg2: torch::Tensor, arg3: torch::Tensor, arg4: torch::Tensor) -> List[torch::Tensor]
419418

@@ -473,6 +472,8 @@ small benchmark to see how much performance we gained from rewriting our op in
473472
C++. We'll run the LLTM forwards and backwards a few times and measure the
474473
duration::
475474

475+
import time
476+
476477
import torch
477478

478479
batch_size = 16

0 commit comments

Comments
 (0)