Skip to content

Commit c3c21da

Browse files
author
Svetlana Karslioglu
authored
Spellcheck intermediate 2 python (#2291)
* Pyspelling: intermediate Python tutorials N-Z
1 parent 2dac3e4 commit c3c21da

15 files changed

+222
-152
lines changed

.pyspelling.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,7 @@ matrix:
33
- name: python
44
sources:
55
- beginner_source/*.py
6-
- intermediate_source/autograd_saved_tensors_hooks_tutorial.py
7-
- intermediate_source/ax_multiobjective_nas_tutorial.py
8-
- intermediate_source/char_rnn_classification_tutorial.py
9-
- intermediate_source/char_rnn_generation_tutorial.py
10-
- intermediate_source/custom_function_conv_bn_tutorial.py
11-
- intermediate_source/ensembling.py
12-
#- intermediate_source/flask_rest_api_tutorial.py
13-
- intermediate_source/forward_ad_usage.py
14-
- intermediate_source/fx_conv_bn_fuser.py
15-
- intermediate_source/fx_profiling_tutorial.py
16-
- intermediate_source/jacobians_hessians.py
17-
- intermediate_source/mario_rl_tutorial.py
18-
- intermediate_source/mnist_train_nas.py
19-
- intermediate_source/memory_format_tutorial.py
20-
- intermediate_source/model_parallel_tutorial.py
6+
- intermediate_source/*.py
217
dictionary:
228
wordlists:
239
- en-wordlist.txt
@@ -30,9 +16,14 @@ matrix:
3016
# Exclude figure rST tags
3117
- open: '\.\.\s+(figure|literalinclude|math|image|grid)::'
3218
close: '\n'
19+
# Exclude roles:
20+
- open: ':(?:(class|py:mod|mod|func)):`'
21+
content: '[^`]*'
22+
close: '`'
3323
# Exclude raw directive
3424
- open: '\.\. (raw)::.*$\n*'
3525
close: '\n'
26+
# Exclude
3627
# Exclude Python coding directives
3728
- open: '-\*- coding:'
3829
close: '\n'
@@ -46,7 +37,7 @@ matrix:
4637
- open: '(?s)^::\n\n '
4738
close: '^\n'
4839
# Ignore reStructuredText block directives
49-
- open: '\.\. (code-block)::.*$\n*'
40+
- open: '\.\. (code-block|math)::.*$\n*'
5041
content: '(?P<first>(^(?P<indent>[ ]+).*$\n))(?P<other>(^([ \t]+.*|[ \t]*)$\n)*)'
5142
close: '(^(?![ \t]+.*$))'
5243
- pyspelling.filters.markdown:

en-wordlist.txt

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
APIs
2+
ATen
23
Args
34
Autograd
45
BCE
@@ -13,38 +14,50 @@ CNNDM
1314
CNNs
1415
CPUs
1516
CUDA
17+
CartPole
18+
Cayley
1619
Chatbots
1720
Colab
1821
Conv
1922
ConvNet
2023
ConvNets
2124
DCGAN
2225
DCGANs
26+
DDP
2327
DDQN
2428
DNN
29+
DQN
2530
DataLoaders
31+
DeepMind
2632
DeiT
2733
DenseNet
2834
EOS
35+
EPS
2936
FC
3037
FGSM
3138
FLAVA
3239
FX
3340
FX's
3441
FloydHub
3542
FloydHub's
43+
Frobenius
44+
GAE
3645
GAN
3746
GANs
47+
GLOO
48+
GPU's
3849
GPUs
3950
GRU
4051
GRUs
52+
GTC
4153
GeForce
4254
Goodfellow
4355
Goodfellow’s
4456
GreedySearchDecoder
4557
HVP
4658
Hugging Face
4759
IMDB
60+
IOT
4861
ImageNet
4962
Initializations
5063
Iteratively
@@ -56,25 +69,32 @@ Kubernetes
5669
Kuei
5770
LSTM
5871
LSTMs
72+
LeCun
5973
LeNet
6074
LeakyReLU
6175
LeakyReLUs
76+
Lipschitz
6277
Lua
6378
Luong
6479
MLP
6580
MLPs
6681
MNIST
82+
MacBook
6783
Mypy
6884
NAS
85+
NCCL
6986
NCHW
7087
NES
7188
NLP
89+
NTK
7290
NaN
91+
NanoGPT
7392
NeurIPS
7493
NumPy
7594
Numericalization
7695
Numpy's
7796
OpenAI
97+
PPO
7898
Plotly
7999
Prec
80100
Profiler
@@ -83,31 +103,48 @@ RGB
83103
RL
84104
RNN
85105
RNNs
106+
RPC
86107
RTX
87108
Radford
88109
ReLU
89110
ResNet
111+
SDPA
112+
SGD
113+
SPD
90114
SST2
115+
STN
91116
Sequentials
92117
Sigmoid
93118
SoTA
94119
TPU
95120
TensorBoard
96121
TextVQA
97122
Tokenization
123+
TorchDynamo
124+
TorchInductor
98125
TorchMultimodal
126+
TorchRL
127+
TorchRL's
99128
TorchScript
100129
TorchX
101130
Tunable
131+
UI
102132
Unescape
103133
VQA
134+
VS Code
104135
Wikitext
105136
Xeon
106137
accuracies
107138
activations
108139
adversarially
140+
affine
109141
al
142+
allocator
143+
allocator's
144+
allocators
145+
approximators
110146
autodiff
147+
autoencoder
111148
autograd
112149
backend
113150
backends
@@ -121,9 +158,13 @@ batchnorm's
121158
benchmarking
122159
boolean
123160
broadcasted
161+
bytecode
162+
cardinality
124163
chatbot
125164
chatbot's
126165
checkpointing
166+
colorbar
167+
compilable
127168
composable
128169
concat
129170
config
@@ -141,11 +182,17 @@ datapipes
141182
dataset
142183
datasets
143184
dataset’s
185+
deallocation
186+
decorrelated
144187
deserialize
145188
deserialized
189+
deterministically
190+
dimensionality
146191
dir
147192
downsample
148193
downsamples
194+
dropdown
195+
duration
149196
embeddings
150197
encodings
151198
ensembling
@@ -161,6 +208,7 @@ finetuning
161208
fp
162209
functorch
163210
fuser
211+
geomean
164212
grayscale
165213
hardcode
166214
helpdesk
@@ -174,16 +222,19 @@ imagenet
174222
initializations
175223
inlined
176224
interpretable
225+
invariance
177226
io
178227
iterable
179228
iteratively
180229
jacobian
181230
jacobians
182231
jit
183232
jpg
233+
judgements
184234
kwargs
185235
labelled
186236
learnable
237+
learnings
187238
loadFilename
188239
manualSeed
189240
matplotlib
@@ -194,29 +245,39 @@ misclassification
194245
misclassified
195246
modularity
196247
modularized
248+
multihead
197249
multimodal
198250
multimodality
199251
multiobjective
252+
multiprocessed
200253
multithreaded
201254
namespace
202255
natively
203256
ndarrays
204257
num
205258
numericalize
206259
numpy
260+
nvFuser
261+
nvFuser's
207262
optimizable
208263
optimizer's
209264
optimizers
210265
overfitting
211266
parallelizable
212267
parallelization
268+
parametrization
269+
parametrizations
270+
parametrized
271+
parametrizing
213272
perceptibility
214273
pipelining
215274
pointwise
275+
precompute
216276
precomputing
217277
prepend
218278
preprocess
219279
preprocessing
280+
prepruned
220281
prespecified
221282
pretrained
222283
prewritten
@@ -229,20 +290,28 @@ quantizing
229290
queryable
230291
randint
231292
readably
293+
recomputation
294+
regressor
295+
reimplement
296+
reimplementing
297+
reimplements
232298
reinitializes
233299
relu
234300
reproducibility
235301
rescale
236302
resnet
237303
restride
238304
rewinded
305+
rollout
239306
romanized
240307
runnable
241308
runtime
242309
runtime
243310
runtimes
244311
scalable
245312
softmax
313+
sparsify
314+
specificities
246315
src
247316
stacktrace
248317
stateful
@@ -252,6 +321,8 @@ subclasses
252321
subclassing
253322
subdirectories
254323
submodule
324+
submodules
325+
subnetworks
255326
subreddit
256327
summarization
257328
tanh
@@ -262,6 +333,8 @@ timesteps
262333
tokenization
263334
tokenize
264335
tokenizer
336+
tooltip
337+
topologies
265338
torchaudio
266339
torchdata
267340
torchscriptable
@@ -277,7 +350,11 @@ uncommented
277350
unfused
278351
unimodal
279352
unnormalized
353+
unoptimized
354+
unparametrized
280355
unpickling
356+
unpruned
357+
updation
281358
utils
282359
vectorization
283360
vectorize

intermediate_source/flask_rest_api_tutorial.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,10 @@ def get_prediction(image_bytes):
318318
#
319319
# .. code-block:: python
320320
#
321-
# import requests
321+
# import requests
322322
#
323-
# resp = requests.post("http://localhost:5000/predict",
324-
# files={"file": open('<PATH/TO/.jpg/FILE>/cat.jpg','rb')})
323+
# resp = requests.post("http://localhost:5000/predict",
324+
# files={"file": open('<PATH/TO/.jpg/FILE>/cat.jpg','rb')})
325325

326326
#######################################################################
327327
# Printing `resp.json()` will now show the following:

intermediate_source/neural_tangent_kernels.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def forward(self, x):
5858
# we will need a function that accepts the parameters of the model and a single
5959
# input (as opposed to a batch of inputs!) and returns a single output.
6060
#
61-
# We'll use ``torch.func.functional_call``, which allows us to call an nn.Module
61+
# We'll use ``torch.func.functional_call``, which allows us to call an ``nn.Module``
6262
# using different parameters/buffers, to help accomplish the first step.
6363
#
6464
# Keep in mind that the model was originally written to accept a batch of input
@@ -200,21 +200,21 @@ def func_x2(params):
200200
output, vjp_fn = vjp(func_x1, params)
201201

202202
def get_ntk_slice(vec):
203-
# This computes vec @ J(x2).T
203+
# This computes ``vec @ J(x2).T``
204204
# `vec` is some unit vector (a single slice of the Identity matrix)
205205
vjps = vjp_fn(vec)
206-
# This computes J(X1) @ vjps
206+
# This computes ``J(X1) @ vjps``
207207
_, jvps = jvp(func_x2, (params,), vjps)
208208
return jvps
209209

210210
# Here's our identity matrix
211211
basis = torch.eye(output.numel(), dtype=output.dtype, device=output.device).view(output.numel(), -1)
212212
return vmap(get_ntk_slice)(basis)
213213

214-
# get_ntk(x1, x2) computes the NTK for a single data point x1, x2
215-
# Since the x1, x2 inputs to empirical_ntk_ntk_vps are batched,
214+
# ``get_ntk(x1, x2)`` computes the NTK for a single data point x1, x2
215+
# Since the x1, x2 inputs to ``empirical_ntk_ntk_vps`` are batched,
216216
# we actually wish to compute the NTK between every pair of data points
217-
# between {x1} and {x2}. That's what the vmaps here do.
217+
# between {x1} and {x2}. That's what the ``vmaps`` here do.
218218
result = vmap(vmap(get_ntk, (None, 0)), (0, None))(x1, x2)
219219

220220
if compute == 'full':

0 commit comments

Comments
 (0)