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

Skip to content

Commit ae949d6

Browse files
Merge branch 'rc1' into rc1
2 parents 31ab1dd + 27f6b35 commit ae949d6

7 files changed

Lines changed: 31 additions & 18 deletions

File tree

.jenkins/build.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,25 @@ sudo apt-get install -y --no-install-recommends unzip p7zip-full sox libsox-dev
33

44
# Install a nightly build of pytorch
55

6-
# GPU, requires CUDA version 9.0 and python version 3.6
7-
pip install cython torch_nightly -f https://download.pytorch.org/whl/nightly/cu90/torch_nightly-2018.8.28.dev1-cp36-cp36m-linux_x86_64.whl
6+
# GPU, requires CUDA version 8.0
7+
pip install cython torch_nightly -f https://download.pytorch.org/whl/nightly/cu80/torch_nightly.html
8+
9+
# GPU, requires CUDA version 9.0
10+
# pip install cython torch_nightly -f https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html
11+
12+
# GPU, requires CUDA version 9.2
13+
# pip install cython torch_nightly -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html
814

915
# CPU
10-
# pip install cython torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly-2018.8.24.dev1-cp36-cp36m-linux_x86_64.whl
16+
# pip install cython torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
1117

1218
## Install doc dependencies
1319

1420
export PATH=/opt/conda/bin:$PATH
1521
# pillow >= 4.2 will throw error when trying to write mode RGBA as JPEG,
1622
# this is a workaround to the issue.
1723
conda install -y sphinx pandas pillow=4.1.1
18-
pip install sphinx-gallery sphinx_rtd_theme tqdm matplotlib ipython
24+
pip install sphinx-gallery pytorch_sphinx_theme tqdm matplotlib ipython
1925

2026
git clone https://github.com/pytorch/vision --quiet
2127
pushd vision

_static/img/hybrid.png

27.2 KB
Loading

advanced_source/cpp_export.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
Loading a PyTorch model in C++
1+
Loading a PyTorch Model in C++
22
==============================
33

4+
This tutorial requires PyTorch 1.0 (preview) or later. For installation information
5+
visit http://pytorch.org/get-started.
6+
47
As its name suggests, the primary interface to PyTorch is the Python
58
programming language. While Python is a suitable and preferred language for
69
many scenarios requiring dynamism and ease of iteration, there are equally many

beginner_source/chatbot_tutorial.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88

99
######################################################################
10+
# This example requires PyTorch 1.0 (preview) or later.
11+
# For installation information visit http://pytorch.org/get-started.
12+
#
1013
# In this tutorial, we explore a fun and interesting use-case of recurrent
1114
# sequence-to-sequence models. We will train a simple chatbot using movie
1215
# scripts from the `Cornell Movie-Dialogs

beginner_source/deploy_seq2seq_hybrid_frontend_tutorial.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77

88

99
######################################################################
10+
# This example requires PyTorch 1.0 (preview) or later. For installation
11+
# information visit http://pytorch.org/get-started.
12+
#
1013
# This tutorial will walk through the process of transitioning a
1114
# sequence-to-sequence model to Torch Script using PyTorch’s Hybrid
1215
# Frontend. The model that we will convert is the chatbot model from the
13-
# `Chatbot tutorial <>`__. While the `introductory hybrid frontend
14-
# tutorials <>`__ are useful for gaining an understanding of the
15-
# work-flow, purpose, and basic syntax of the feature, this document
16-
# covers a more challenging model and a more practical use-case. You can
17-
# either treat this tutorial as a “Part 2” to the `Chatbot tutorial <>`__
16+
# `Chatbot tutorial <https://pytorch.org/tutorials/beginner/chatbot_tutorial.html>`__.
17+
# You can either treat this tutorial as a “Part 2” to the Chatbot tutorial
1818
# and deploy your own pretrained model, or you can start with this
1919
# document and use a pretrained model that we host. In the latter case,
20-
# you can reference the original `Chatbot tutorial <>`__ for details
20+
# you can reference the original Chatbot tutorial for details
2121
# regarding data preprocessing, model theory and definition, and model
2222
# training.
2323
#
@@ -117,10 +117,9 @@
117117
import unicodedata
118118
import numpy as np
119119

120-
121-
USE_CUDA = torch.cuda.is_available()
122120
device = torch.device("cpu")
123121

122+
124123
MAX_LENGTH = 10 # Maximum sentence length
125124

126125
# Default word tokens
@@ -728,10 +727,9 @@ def evaluateExample(sentence, encoder, decoder, searcher, voc):
728727
dropout = 0.1
729728
batch_size = 64
730729

730+
# If you're loading your own model
731731
# Set checkpoint to load from
732732
checkpoint_iter = 4000
733-
734-
# If you're loading your own model
735733
# loadFilename = os.path.join(save_dir, model_name, corpus_name,
736734
# '{}-{}_{}'.format(encoder_n_layers, decoder_n_layers, hidden_size),
737735
# '{}_checkpoint.tar'.format(checkpoint_iter))

beginner_source/hybrid_frontend/learning_hybrid_frontend_through_example_tutorial.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
===============================================
55
**Author:** `Nathan Inkawhich <https://github.com/inkawhich>`_
66
7+
This tutorial requires PyTorch 1.0 (preview) or later. For installation
8+
information visit http://pytorch.org/get-started.
9+
710
This document is meant to highlight the syntax of the Hybrid Frontend
811
through a non-code intensive example. The Hybrid Frontend is one of the
912
new shiny features of Pytorch 1.0 and provides an avenue for developers

index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ Getting Started
4343
:description: :doc:`beginner/transfer_learning_tutorial`
4444

4545
.. customgalleryitem::
46-
:figure: /_static/img/hybrid_frontend/220px-KnnClassification.png
46+
:figure: /_static/img/hybrid.png
4747
:tooltip: Experiment with some of the key features of the PyTorch hybrid frontend
48-
:description: :doc:`beginner/hybrid_frontend_tutorial`
48+
:description: :doc:`beginner/deploy_seq2seq_hybrid_frontend_tutorial`
4949

5050
.. customgalleryitem::
5151
:figure: /_static/img/thumbnails/floppy.png
@@ -214,7 +214,7 @@ Production Usage
214214
beginner/data_loading_tutorial
215215
beginner/pytorch_with_examples
216216
beginner/transfer_learning_tutorial
217-
beginner/hybrid_frontend_tutorial
217+
beginner/deploy_seq2seq_hybrid_frontend_tutorial
218218
beginner/saving_loading_models
219219

220220
.. toctree::

0 commit comments

Comments
 (0)