Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d12fcca

Browse files
authored
Merge branch 'master' into audio
2 parents f74ad57 + 671a338 commit d12fcca

17 files changed

Lines changed: 691 additions & 745 deletions

.jenkins/build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ pip install -e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch
3030
pip install sphinx-gallery==0.3.1 tqdm matplotlib ipython pillow==4.1.1
3131

3232
# Install torchaudio from source
33-
# git clone https://github.com/pytorch/audio --quiet
34-
# pushd audio
35-
# python setup.py install
36-
# popd
33+
git clone https://github.com/pytorch/audio --quiet
34+
pushd audio
35+
python setup.py install
36+
popd
3737

3838
aws configure set default.s3.multipart_threshold 5120MB
3939

@@ -185,4 +185,4 @@ else
185185
fi
186186

187187
rm -rf vision
188-
# rm -rf audio
188+
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)