torchwrench 0.9.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- torchwrench/__init__.py +703 -0
- torchwrench/__main__.py +7 -0
- torchwrench/core/__init__.py +2 -0
- torchwrench/core/config.py +5 -0
- torchwrench/core/dtype.py +21 -0
- torchwrench/core/dtype_enum.py +195 -0
- torchwrench/core/make.py +127 -0
- torchwrench/core/packaging.py +143 -0
- torchwrench/core/version.py +24 -0
- torchwrench/entrypoints/info.py +49 -0
- torchwrench/extras/__init__.py +2 -0
- torchwrench/extras/audio.py +142 -0
- torchwrench/extras/colorlog.py +44 -0
- torchwrench/extras/hdf/__init__.py +25 -0
- torchwrench/extras/hdf/common.py +78 -0
- torchwrench/extras/hdf/dataset.py +708 -0
- torchwrench/extras/hdf/pack.py +663 -0
- torchwrench/extras/numpy/__init__.py +102 -0
- torchwrench/extras/numpy/_numpy_fallback.py +91 -0
- torchwrench/extras/numpy/definitions.py +41 -0
- torchwrench/extras/numpy/functional.py +230 -0
- torchwrench/extras/numpy/saving.py +82 -0
- torchwrench/extras/numpy/scan_info.py +216 -0
- torchwrench/extras/pandas/__init__.py +25 -0
- torchwrench/extras/pandas/_pandas_fallback.py +32 -0
- torchwrench/extras/pandas/definitions.py +12 -0
- torchwrench/extras/safetensors.py +100 -0
- torchwrench/extras/speechbrain/__init__.py +23 -0
- torchwrench/extras/speechbrain/_speechbrain_fallback.py +14 -0
- torchwrench/extras/speechbrain/definitions.py +11 -0
- torchwrench/extras/tensorboard.py +176 -0
- torchwrench/extras/yaml/__init__.py +42 -0
- torchwrench/extras/yaml/_yaml_fallback.py +63 -0
- torchwrench/extras/yaml/definitions.py +76 -0
- torchwrench/extras/yaml/yaml.py +221 -0
- torchwrench/hub/__init__.py +35 -0
- torchwrench/hub/download.py +98 -0
- torchwrench/hub/paths.py +41 -0
- torchwrench/hub/registry.py +254 -0
- torchwrench/nn/__init__.py +507 -0
- torchwrench/nn/functional/__init__.py +427 -0
- torchwrench/nn/functional/activation.py +28 -0
- torchwrench/nn/functional/checksum.py +178 -0
- torchwrench/nn/functional/cropping.py +116 -0
- torchwrench/nn/functional/indices.py +174 -0
- torchwrench/nn/functional/make.py +17 -0
- torchwrench/nn/functional/mask.py +477 -0
- torchwrench/nn/functional/multiclass.py +315 -0
- torchwrench/nn/functional/multilabel.py +510 -0
- torchwrench/nn/functional/new.py +1399 -0
- torchwrench/nn/functional/others.py +572 -0
- torchwrench/nn/functional/padding.py +378 -0
- torchwrench/nn/functional/powerset.py +177 -0
- torchwrench/nn/functional/predicate.py +264 -0
- torchwrench/nn/functional/segments.py +218 -0
- torchwrench/nn/functional/transform.py +1187 -0
- torchwrench/nn/modules/__init__.py +374 -0
- torchwrench/nn/modules/_mixins.py +698 -0
- torchwrench/nn/modules/activation.py +55 -0
- torchwrench/nn/modules/container.py +168 -0
- torchwrench/nn/modules/crop.py +88 -0
- torchwrench/nn/modules/layer.py +65 -0
- torchwrench/nn/modules/mask.py +55 -0
- torchwrench/nn/modules/module.py +10 -0
- torchwrench/nn/modules/multiclass.py +277 -0
- torchwrench/nn/modules/multilabel.py +302 -0
- torchwrench/nn/modules/numpy.py +85 -0
- torchwrench/nn/modules/padding.py +160 -0
- torchwrench/nn/modules/powerset.py +82 -0
- torchwrench/nn/modules/tensor.py +566 -0
- torchwrench/nn/modules/transform.py +521 -0
- torchwrench/optim/__init__.py +25 -0
- torchwrench/optim/schedulers.py +43 -0
- torchwrench/optim/utils.py +83 -0
- torchwrench/serialization/__init__.py +34 -0
- torchwrench/serialization/common.py +184 -0
- torchwrench/serialization/csv.py +286 -0
- torchwrench/serialization/dump_fn.py +101 -0
- torchwrench/serialization/hdf.py +18 -0
- torchwrench/serialization/json.py +23 -0
- torchwrench/serialization/load_fn.py +136 -0
- torchwrench/serialization/numpy.py +11 -0
- torchwrench/serialization/pickle.py +23 -0
- torchwrench/serialization/safetensors.py +7 -0
- torchwrench/serialization/torch.py +94 -0
- torchwrench/serialization/torchaudio.py +10 -0
- torchwrench/serialization/yaml.py +14 -0
- torchwrench/types/__init__.py +229 -0
- torchwrench/types/_typing.py +117 -0
- torchwrench/types/guards.py +62 -0
- torchwrench/types/tensor_subclasses.py +2735 -0
- torchwrench/types/variable_fns.py +17 -0
- torchwrench/utils/__init__.py +24 -0
- torchwrench/utils/data/__init__.py +37 -0
- torchwrench/utils/data/collate.py +97 -0
- torchwrench/utils/data/dataloader.py +18 -0
- torchwrench/utils/data/dataset/__init__.py +40 -0
- torchwrench/utils/data/dataset/_core.py +730 -0
- torchwrench/utils/data/dataset/slicer.py +175 -0
- torchwrench/utils/data/dataset/tabular.py +238 -0
- torchwrench/utils/data/dataset/wrapper.py +210 -0
- torchwrench/utils/data/sampler.py +194 -0
- torchwrench/utils/data/slicer.py +7 -0
- torchwrench/utils/data/split.py +155 -0
- torchwrench/utils/data/tabular.py +7 -0
- torchwrench/utils/disk_cache.py +14 -0
- torchwrench/utils/pkg_hooks.py +7 -0
- torchwrench/utils/return_types.py +75 -0
- torchwrench/utils/rng.py +25 -0
- torchwrench-0.9.2.dist-info/METADATA +342 -0
- torchwrench-0.9.2.dist-info/RECORD +114 -0
- torchwrench-0.9.2.dist-info/WHEEL +4 -0
- torchwrench-0.9.2.dist-info/entry_points.txt +4 -0
- torchwrench-0.9.2.dist-info/licenses/LICENSE +21 -0
torchwrench/__init__.py
ADDED
|
@@ -0,0 +1,703 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""Collection of functions and modules to help development in PyTorch."""
|
|
5
|
+
|
|
6
|
+
__name__ = "torchwrench"
|
|
7
|
+
__author__ = "Étienne Labbé (Labbeti)"
|
|
8
|
+
__author_email__ = "labbeti.pub@gmail.com"
|
|
9
|
+
__license__ = "MIT"
|
|
10
|
+
__maintainer__ = "Étienne Labbé (Labbeti)"
|
|
11
|
+
__status__ = "Development"
|
|
12
|
+
__version__ = "0.9.2"
|
|
13
|
+
|
|
14
|
+
from typing import TYPE_CHECKING
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
# Re-import torchwrench modules for language servers
|
|
18
|
+
from . import core as core
|
|
19
|
+
from . import extras as extras
|
|
20
|
+
from . import hub as hub
|
|
21
|
+
from . import nn as nn
|
|
22
|
+
from . import optim as optim
|
|
23
|
+
from . import serialization as serialization
|
|
24
|
+
from . import types as types
|
|
25
|
+
from . import utils as utils
|
|
26
|
+
from .core.dtype import (
|
|
27
|
+
complex64,
|
|
28
|
+
complex128,
|
|
29
|
+
double,
|
|
30
|
+
float,
|
|
31
|
+
float16,
|
|
32
|
+
float32,
|
|
33
|
+
float64,
|
|
34
|
+
half,
|
|
35
|
+
int,
|
|
36
|
+
int8,
|
|
37
|
+
int16,
|
|
38
|
+
int32,
|
|
39
|
+
int64,
|
|
40
|
+
long,
|
|
41
|
+
short,
|
|
42
|
+
uint8,
|
|
43
|
+
)
|
|
44
|
+
from .core.dtype_enum import DTypeEnum
|
|
45
|
+
from .core.make import (
|
|
46
|
+
CUDA_IF_AVAILABLE,
|
|
47
|
+
Device,
|
|
48
|
+
DeviceLike,
|
|
49
|
+
DTypeLike,
|
|
50
|
+
Generator,
|
|
51
|
+
GeneratorLike,
|
|
52
|
+
)
|
|
53
|
+
from .core.version import get_githash_full, get_githash_short
|
|
54
|
+
from .extras.numpy import ndarray_to_tensor, tensor_to_ndarray, to_ndarray
|
|
55
|
+
from .hub.download import download_file
|
|
56
|
+
from .hub.paths import get_cache_dir, get_tmp_dir
|
|
57
|
+
from .nn.functional import (
|
|
58
|
+
activity_to_segments,
|
|
59
|
+
activity_to_segments_list,
|
|
60
|
+
all_eq,
|
|
61
|
+
all_ne,
|
|
62
|
+
arange,
|
|
63
|
+
as_device,
|
|
64
|
+
as_dtype,
|
|
65
|
+
as_generator,
|
|
66
|
+
as_tensor,
|
|
67
|
+
average_power,
|
|
68
|
+
cat,
|
|
69
|
+
cat_padded_batch,
|
|
70
|
+
checksum_any,
|
|
71
|
+
checksum_object,
|
|
72
|
+
concat,
|
|
73
|
+
count_parameters,
|
|
74
|
+
crop_dim,
|
|
75
|
+
crop_dims,
|
|
76
|
+
deep_equal,
|
|
77
|
+
empty,
|
|
78
|
+
equal,
|
|
79
|
+
find,
|
|
80
|
+
flatten,
|
|
81
|
+
full,
|
|
82
|
+
generate_square_subsequent_mask,
|
|
83
|
+
get_default_device,
|
|
84
|
+
get_default_dtype,
|
|
85
|
+
get_default_generator,
|
|
86
|
+
get_inverse_perm,
|
|
87
|
+
get_ndim,
|
|
88
|
+
get_perm_indices,
|
|
89
|
+
get_shape,
|
|
90
|
+
identity,
|
|
91
|
+
index_to_name,
|
|
92
|
+
index_to_onehot,
|
|
93
|
+
indices_to_multihot,
|
|
94
|
+
indices_to_multinames,
|
|
95
|
+
initial_seed,
|
|
96
|
+
insert_at_indices,
|
|
97
|
+
is_complex,
|
|
98
|
+
is_convertible_to_tensor,
|
|
99
|
+
is_floating_point,
|
|
100
|
+
is_full,
|
|
101
|
+
is_sorted,
|
|
102
|
+
is_stackable,
|
|
103
|
+
is_tensor,
|
|
104
|
+
is_unique,
|
|
105
|
+
lengths_to_non_pad_mask,
|
|
106
|
+
lengths_to_pad_mask,
|
|
107
|
+
lengths_to_ratios,
|
|
108
|
+
log_softmax_multidim,
|
|
109
|
+
manual_seed,
|
|
110
|
+
masked_equal,
|
|
111
|
+
masked_mean,
|
|
112
|
+
masked_sum,
|
|
113
|
+
matmul,
|
|
114
|
+
move_to,
|
|
115
|
+
move_to_rec,
|
|
116
|
+
mse,
|
|
117
|
+
multi_indices_to_multihot,
|
|
118
|
+
multi_indices_to_multinames,
|
|
119
|
+
multihot_to_indices,
|
|
120
|
+
multihot_to_multi_indices,
|
|
121
|
+
multihot_to_multinames,
|
|
122
|
+
multilabel_to_powerset,
|
|
123
|
+
multinames_to_indices,
|
|
124
|
+
multinames_to_multi_indices,
|
|
125
|
+
multinames_to_multihot,
|
|
126
|
+
name_to_index,
|
|
127
|
+
name_to_onehot,
|
|
128
|
+
ndim,
|
|
129
|
+
nelement,
|
|
130
|
+
no_grad,
|
|
131
|
+
non_pad_mask_to_lengths,
|
|
132
|
+
non_pad_mask_to_ratios,
|
|
133
|
+
one_hot,
|
|
134
|
+
onehot_to_index,
|
|
135
|
+
onehot_to_name,
|
|
136
|
+
ones,
|
|
137
|
+
pad_and_crop_dim,
|
|
138
|
+
pad_and_stack_rec,
|
|
139
|
+
pad_dim,
|
|
140
|
+
pad_dims,
|
|
141
|
+
pad_mask_to_lengths,
|
|
142
|
+
pad_mask_to_ratios,
|
|
143
|
+
powerset_to_multilabel,
|
|
144
|
+
probs_to_index,
|
|
145
|
+
probs_to_indices,
|
|
146
|
+
probs_to_multi_indices,
|
|
147
|
+
probs_to_multihot,
|
|
148
|
+
probs_to_multinames,
|
|
149
|
+
probs_to_name,
|
|
150
|
+
probs_to_onehot,
|
|
151
|
+
prod,
|
|
152
|
+
rand,
|
|
153
|
+
randint,
|
|
154
|
+
randn,
|
|
155
|
+
randperm,
|
|
156
|
+
randperm_diff,
|
|
157
|
+
ranks,
|
|
158
|
+
ratios_to_lengths,
|
|
159
|
+
ratios_to_non_pad_mask,
|
|
160
|
+
ratios_to_pad_mask,
|
|
161
|
+
recursive_to,
|
|
162
|
+
remove_at_indices,
|
|
163
|
+
repeat_interleave_nd,
|
|
164
|
+
resample_nearest_freqs,
|
|
165
|
+
resample_nearest_rates,
|
|
166
|
+
resample_nearest_steps,
|
|
167
|
+
rmse,
|
|
168
|
+
seed,
|
|
169
|
+
segments_list_to_activity,
|
|
170
|
+
segments_to_activity,
|
|
171
|
+
segments_to_segments_list,
|
|
172
|
+
set_default_dtype,
|
|
173
|
+
set_default_generator,
|
|
174
|
+
shape,
|
|
175
|
+
shuffled,
|
|
176
|
+
softmax_multidim,
|
|
177
|
+
split,
|
|
178
|
+
squeeze,
|
|
179
|
+
squeeze_,
|
|
180
|
+
squeeze_copy,
|
|
181
|
+
stack,
|
|
182
|
+
tensor_to_lengths,
|
|
183
|
+
tensor_to_non_pad_mask,
|
|
184
|
+
tensor_to_pad_mask,
|
|
185
|
+
tensor_to_tensors_list,
|
|
186
|
+
tensors_list_to_lengths,
|
|
187
|
+
to_item,
|
|
188
|
+
to_tensor,
|
|
189
|
+
top_k,
|
|
190
|
+
top_p,
|
|
191
|
+
topk,
|
|
192
|
+
transform_drop,
|
|
193
|
+
unsqueeze,
|
|
194
|
+
unsqueeze_,
|
|
195
|
+
unsqueeze_copy,
|
|
196
|
+
view_as_complex,
|
|
197
|
+
view_as_real,
|
|
198
|
+
where,
|
|
199
|
+
zeros,
|
|
200
|
+
)
|
|
201
|
+
from .serialization.common import as_builtin
|
|
202
|
+
from .serialization.csv import (
|
|
203
|
+
dump_csv,
|
|
204
|
+
dumps_csv,
|
|
205
|
+
load_csv,
|
|
206
|
+
loads_csv,
|
|
207
|
+
read_csv,
|
|
208
|
+
save_csv,
|
|
209
|
+
)
|
|
210
|
+
from .serialization.dump_fn import dump_to, save_to
|
|
211
|
+
from .serialization.json import (
|
|
212
|
+
dump_json,
|
|
213
|
+
dumps_json,
|
|
214
|
+
load_json,
|
|
215
|
+
loads_json,
|
|
216
|
+
read_json,
|
|
217
|
+
save_json,
|
|
218
|
+
)
|
|
219
|
+
from .serialization.load_fn import load_from, read_from
|
|
220
|
+
from .serialization.pickle import (
|
|
221
|
+
dump_pickle,
|
|
222
|
+
dumps_pickle,
|
|
223
|
+
load_pickle,
|
|
224
|
+
loads_pickle,
|
|
225
|
+
read_pickle,
|
|
226
|
+
save_pickle,
|
|
227
|
+
)
|
|
228
|
+
from .serialization.torch import dump_torch, load, load_torch, save
|
|
229
|
+
from .serialization.yaml import (
|
|
230
|
+
dump_yaml,
|
|
231
|
+
dumps_yaml,
|
|
232
|
+
load_yaml,
|
|
233
|
+
loads_yaml,
|
|
234
|
+
read_yaml,
|
|
235
|
+
save_yaml,
|
|
236
|
+
)
|
|
237
|
+
from .types import Tensor
|
|
238
|
+
from .types.guards import (
|
|
239
|
+
is_builtin_collection,
|
|
240
|
+
is_builtin_number,
|
|
241
|
+
is_builtin_obj,
|
|
242
|
+
is_builtin_scalar,
|
|
243
|
+
is_dataclass_instance,
|
|
244
|
+
is_namedtuple_instance,
|
|
245
|
+
is_number_like,
|
|
246
|
+
is_scalar_like,
|
|
247
|
+
is_tensor_or_array,
|
|
248
|
+
is_typed_dict,
|
|
249
|
+
isinstance_generic,
|
|
250
|
+
)
|
|
251
|
+
from .types.tensor_subclasses import (
|
|
252
|
+
BoolTensor,
|
|
253
|
+
BoolTensor0D,
|
|
254
|
+
BoolTensor1D,
|
|
255
|
+
BoolTensor2D,
|
|
256
|
+
BoolTensor3D,
|
|
257
|
+
ByteTensor,
|
|
258
|
+
ByteTensor0D,
|
|
259
|
+
ByteTensor1D,
|
|
260
|
+
ByteTensor2D,
|
|
261
|
+
ByteTensor3D,
|
|
262
|
+
CDoubleTensor,
|
|
263
|
+
CDoubleTensor0D,
|
|
264
|
+
CDoubleTensor1D,
|
|
265
|
+
CDoubleTensor2D,
|
|
266
|
+
CDoubleTensor3D,
|
|
267
|
+
CFloatTensor,
|
|
268
|
+
CFloatTensor0D,
|
|
269
|
+
CFloatTensor1D,
|
|
270
|
+
CFloatTensor2D,
|
|
271
|
+
CFloatTensor3D,
|
|
272
|
+
CharTensor,
|
|
273
|
+
CharTensor0D,
|
|
274
|
+
CharTensor1D,
|
|
275
|
+
CharTensor2D,
|
|
276
|
+
CharTensor3D,
|
|
277
|
+
ComplexFloatingTensor,
|
|
278
|
+
ComplexFloatingTensor0D,
|
|
279
|
+
ComplexFloatingTensor1D,
|
|
280
|
+
ComplexFloatingTensor2D,
|
|
281
|
+
ComplexFloatingTensor3D,
|
|
282
|
+
DoubleTensor,
|
|
283
|
+
DoubleTensor0D,
|
|
284
|
+
DoubleTensor1D,
|
|
285
|
+
DoubleTensor2D,
|
|
286
|
+
DoubleTensor3D,
|
|
287
|
+
FloatingTensor,
|
|
288
|
+
FloatingTensor0D,
|
|
289
|
+
FloatingTensor1D,
|
|
290
|
+
FloatingTensor2D,
|
|
291
|
+
FloatingTensor3D,
|
|
292
|
+
FloatTensor,
|
|
293
|
+
FloatTensor0D,
|
|
294
|
+
FloatTensor1D,
|
|
295
|
+
FloatTensor2D,
|
|
296
|
+
FloatTensor3D,
|
|
297
|
+
HalfTensor,
|
|
298
|
+
HalfTensor0D,
|
|
299
|
+
HalfTensor1D,
|
|
300
|
+
HalfTensor2D,
|
|
301
|
+
HalfTensor3D,
|
|
302
|
+
IntegralTensor,
|
|
303
|
+
IntegralTensor0D,
|
|
304
|
+
IntegralTensor1D,
|
|
305
|
+
IntegralTensor2D,
|
|
306
|
+
IntegralTensor3D,
|
|
307
|
+
IntTensor,
|
|
308
|
+
IntTensor0D,
|
|
309
|
+
IntTensor1D,
|
|
310
|
+
IntTensor2D,
|
|
311
|
+
IntTensor3D,
|
|
312
|
+
LongTensor,
|
|
313
|
+
LongTensor0D,
|
|
314
|
+
LongTensor1D,
|
|
315
|
+
LongTensor2D,
|
|
316
|
+
LongTensor3D,
|
|
317
|
+
RealTensor,
|
|
318
|
+
RealTensor0D,
|
|
319
|
+
RealTensor1D,
|
|
320
|
+
RealTensor2D,
|
|
321
|
+
RealTensor3D,
|
|
322
|
+
ShortTensor,
|
|
323
|
+
ShortTensor0D,
|
|
324
|
+
ShortTensor1D,
|
|
325
|
+
ShortTensor2D,
|
|
326
|
+
ShortTensor3D,
|
|
327
|
+
SignedIntegerTensor,
|
|
328
|
+
SignedIntegerTensor0D,
|
|
329
|
+
SignedIntegerTensor1D,
|
|
330
|
+
SignedIntegerTensor2D,
|
|
331
|
+
SignedIntegerTensor3D,
|
|
332
|
+
Tensor0D,
|
|
333
|
+
Tensor1D,
|
|
334
|
+
Tensor2D,
|
|
335
|
+
Tensor3D,
|
|
336
|
+
UnsignedIntegerTensor,
|
|
337
|
+
UnsignedIntegerTensor0D,
|
|
338
|
+
UnsignedIntegerTensor1D,
|
|
339
|
+
UnsignedIntegerTensor2D,
|
|
340
|
+
UnsignedIntegerTensor3D,
|
|
341
|
+
)
|
|
342
|
+
from .utils.disk_cache import disk_cache_call, disk_cache_decorator, register_hooks
|
|
343
|
+
from .utils.rng import set_seed
|
|
344
|
+
|
|
345
|
+
else:
|
|
346
|
+
import lazy_loader as lazy
|
|
347
|
+
|
|
348
|
+
__getattr__, __dir__, _ = lazy.attach(
|
|
349
|
+
__name__,
|
|
350
|
+
submodules=[
|
|
351
|
+
"core",
|
|
352
|
+
"extras",
|
|
353
|
+
"hub",
|
|
354
|
+
"nn",
|
|
355
|
+
"optim",
|
|
356
|
+
"serialization",
|
|
357
|
+
"types",
|
|
358
|
+
"utils",
|
|
359
|
+
],
|
|
360
|
+
submod_attrs={
|
|
361
|
+
"core.dtype_enum": [
|
|
362
|
+
"DTypeEnum",
|
|
363
|
+
],
|
|
364
|
+
"core.dtype": [
|
|
365
|
+
"complex64",
|
|
366
|
+
"complex128",
|
|
367
|
+
"double",
|
|
368
|
+
"float",
|
|
369
|
+
"float16",
|
|
370
|
+
"float32",
|
|
371
|
+
"float64",
|
|
372
|
+
"half",
|
|
373
|
+
"int",
|
|
374
|
+
"int8",
|
|
375
|
+
"int16",
|
|
376
|
+
"int32",
|
|
377
|
+
"int64",
|
|
378
|
+
"long",
|
|
379
|
+
"short",
|
|
380
|
+
"uint8",
|
|
381
|
+
],
|
|
382
|
+
"core.make": [
|
|
383
|
+
"CUDA_IF_AVAILABLE",
|
|
384
|
+
"Device",
|
|
385
|
+
"DeviceLike",
|
|
386
|
+
"DTypeLike",
|
|
387
|
+
"Generator",
|
|
388
|
+
"GeneratorLike",
|
|
389
|
+
],
|
|
390
|
+
"core.version": ["get_githash_full", "get_githash_short"],
|
|
391
|
+
"extras.numpy": ["ndarray_to_tensor", "tensor_to_ndarray", "to_ndarray"],
|
|
392
|
+
"hub.download": ["download_file"],
|
|
393
|
+
"hub.paths": ["get_cache_dir", "get_tmp_dir"],
|
|
394
|
+
"nn.functional": [
|
|
395
|
+
"log_softmax_multidim",
|
|
396
|
+
"softmax_multidim",
|
|
397
|
+
"checksum_any",
|
|
398
|
+
"checksum_object",
|
|
399
|
+
"crop_dim",
|
|
400
|
+
"crop_dims",
|
|
401
|
+
"get_inverse_perm",
|
|
402
|
+
"get_perm_indices",
|
|
403
|
+
"insert_at_indices",
|
|
404
|
+
"randperm_diff",
|
|
405
|
+
"remove_at_indices",
|
|
406
|
+
"as_device",
|
|
407
|
+
"as_dtype",
|
|
408
|
+
"as_generator",
|
|
409
|
+
"get_default_device",
|
|
410
|
+
"get_default_dtype",
|
|
411
|
+
"get_default_generator",
|
|
412
|
+
"set_default_dtype",
|
|
413
|
+
"set_default_generator",
|
|
414
|
+
"generate_square_subsequent_mask",
|
|
415
|
+
"lengths_to_non_pad_mask",
|
|
416
|
+
"lengths_to_pad_mask",
|
|
417
|
+
"lengths_to_ratios",
|
|
418
|
+
"masked_equal",
|
|
419
|
+
"masked_mean",
|
|
420
|
+
"masked_sum",
|
|
421
|
+
"non_pad_mask_to_lengths",
|
|
422
|
+
"non_pad_mask_to_ratios",
|
|
423
|
+
"pad_mask_to_lengths",
|
|
424
|
+
"pad_mask_to_ratios",
|
|
425
|
+
"ratios_to_lengths",
|
|
426
|
+
"ratios_to_non_pad_mask",
|
|
427
|
+
"ratios_to_pad_mask",
|
|
428
|
+
"tensor_to_lengths",
|
|
429
|
+
"tensor_to_non_pad_mask",
|
|
430
|
+
"tensor_to_pad_mask",
|
|
431
|
+
"tensor_to_tensors_list",
|
|
432
|
+
"tensors_list_to_lengths",
|
|
433
|
+
"index_to_name",
|
|
434
|
+
"index_to_onehot",
|
|
435
|
+
"name_to_index",
|
|
436
|
+
"name_to_onehot",
|
|
437
|
+
"one_hot",
|
|
438
|
+
"onehot_to_index",
|
|
439
|
+
"onehot_to_name",
|
|
440
|
+
"probs_to_index",
|
|
441
|
+
"probs_to_name",
|
|
442
|
+
"probs_to_onehot",
|
|
443
|
+
"indices_to_multihot",
|
|
444
|
+
"indices_to_multinames",
|
|
445
|
+
"multi_indices_to_multihot",
|
|
446
|
+
"multi_indices_to_multinames",
|
|
447
|
+
"multihot_to_indices",
|
|
448
|
+
"multihot_to_multi_indices",
|
|
449
|
+
"multihot_to_multinames",
|
|
450
|
+
"multinames_to_indices",
|
|
451
|
+
"multinames_to_multi_indices",
|
|
452
|
+
"multinames_to_multihot",
|
|
453
|
+
"probs_to_indices",
|
|
454
|
+
"probs_to_multi_indices",
|
|
455
|
+
"probs_to_multihot",
|
|
456
|
+
"probs_to_multinames",
|
|
457
|
+
"arange",
|
|
458
|
+
"empty",
|
|
459
|
+
"full",
|
|
460
|
+
"ones",
|
|
461
|
+
"rand",
|
|
462
|
+
"randn",
|
|
463
|
+
"randint",
|
|
464
|
+
"randperm",
|
|
465
|
+
"zeros",
|
|
466
|
+
"average_power",
|
|
467
|
+
"cat",
|
|
468
|
+
"concat",
|
|
469
|
+
"count_parameters",
|
|
470
|
+
"deep_equal",
|
|
471
|
+
"find",
|
|
472
|
+
"get_ndim",
|
|
473
|
+
"get_shape",
|
|
474
|
+
"mse",
|
|
475
|
+
"ndim",
|
|
476
|
+
"nelement",
|
|
477
|
+
"prod",
|
|
478
|
+
"ranks",
|
|
479
|
+
"rmse",
|
|
480
|
+
"shape",
|
|
481
|
+
"stack",
|
|
482
|
+
"cat_padded_batch",
|
|
483
|
+
"pad_and_stack_rec",
|
|
484
|
+
"pad_dim",
|
|
485
|
+
"pad_dims",
|
|
486
|
+
"multilabel_to_powerset",
|
|
487
|
+
"powerset_to_multilabel",
|
|
488
|
+
"all_eq",
|
|
489
|
+
"all_ne",
|
|
490
|
+
"is_complex",
|
|
491
|
+
"is_convertible_to_tensor",
|
|
492
|
+
"is_floating_point",
|
|
493
|
+
"is_full",
|
|
494
|
+
"is_sorted",
|
|
495
|
+
"is_stackable",
|
|
496
|
+
"is_tensor",
|
|
497
|
+
"is_unique",
|
|
498
|
+
"activity_to_segments",
|
|
499
|
+
"activity_to_segments_list",
|
|
500
|
+
"segments_list_to_activity",
|
|
501
|
+
"segments_to_activity",
|
|
502
|
+
"segments_to_segments_list",
|
|
503
|
+
"as_tensor",
|
|
504
|
+
"flatten",
|
|
505
|
+
"identity",
|
|
506
|
+
"move_to",
|
|
507
|
+
"move_to_rec",
|
|
508
|
+
"pad_and_crop_dim",
|
|
509
|
+
"recursive_to",
|
|
510
|
+
"repeat_interleave_nd",
|
|
511
|
+
"resample_nearest_freqs",
|
|
512
|
+
"resample_nearest_rates",
|
|
513
|
+
"resample_nearest_steps",
|
|
514
|
+
"shuffled",
|
|
515
|
+
"squeeze",
|
|
516
|
+
"squeeze_",
|
|
517
|
+
"squeeze_copy",
|
|
518
|
+
"to_item",
|
|
519
|
+
"to_tensor",
|
|
520
|
+
"top_k",
|
|
521
|
+
"top_p",
|
|
522
|
+
"topk",
|
|
523
|
+
"transform_drop",
|
|
524
|
+
"unsqueeze",
|
|
525
|
+
"unsqueeze_",
|
|
526
|
+
"unsqueeze_copy",
|
|
527
|
+
"view_as_complex",
|
|
528
|
+
"view_as_real",
|
|
529
|
+
"equal",
|
|
530
|
+
"initial_seed",
|
|
531
|
+
"manual_seed",
|
|
532
|
+
"matmul",
|
|
533
|
+
"no_grad",
|
|
534
|
+
"seed",
|
|
535
|
+
"split",
|
|
536
|
+
"where",
|
|
537
|
+
],
|
|
538
|
+
"serialization.common": [
|
|
539
|
+
"as_builtin",
|
|
540
|
+
],
|
|
541
|
+
"serialization.csv": [
|
|
542
|
+
"dump_csv",
|
|
543
|
+
"dumps_csv",
|
|
544
|
+
"load_csv",
|
|
545
|
+
"loads_csv",
|
|
546
|
+
"read_csv",
|
|
547
|
+
"save_csv",
|
|
548
|
+
],
|
|
549
|
+
"serialization.dump_fn": [
|
|
550
|
+
"save_to",
|
|
551
|
+
"dump_to",
|
|
552
|
+
],
|
|
553
|
+
"serialization.json": [
|
|
554
|
+
"dump_json",
|
|
555
|
+
"dumps_json",
|
|
556
|
+
"load_json",
|
|
557
|
+
"loads_json",
|
|
558
|
+
"read_json",
|
|
559
|
+
"save_json",
|
|
560
|
+
],
|
|
561
|
+
"serialization.load_fn": [
|
|
562
|
+
"load_from",
|
|
563
|
+
"read_from",
|
|
564
|
+
],
|
|
565
|
+
"serialization.pickle": [
|
|
566
|
+
"dump_pickle",
|
|
567
|
+
"dumps_pickle",
|
|
568
|
+
"load_pickle",
|
|
569
|
+
"loads_pickle",
|
|
570
|
+
"read_pickle",
|
|
571
|
+
"save_pickle",
|
|
572
|
+
],
|
|
573
|
+
"serialization.torch": ["dump_torch", "load_torch", "save", "load"],
|
|
574
|
+
"serialization.yaml": [
|
|
575
|
+
"dump_yaml",
|
|
576
|
+
"dumps_yaml",
|
|
577
|
+
"load_yaml",
|
|
578
|
+
"loads_yaml",
|
|
579
|
+
"read_yaml",
|
|
580
|
+
"save_yaml",
|
|
581
|
+
],
|
|
582
|
+
"types": [
|
|
583
|
+
"Tensor",
|
|
584
|
+
],
|
|
585
|
+
"types.guards": [
|
|
586
|
+
"is_number_like",
|
|
587
|
+
"is_scalar_like",
|
|
588
|
+
"is_tensor_or_array",
|
|
589
|
+
"is_builtin_collection",
|
|
590
|
+
"is_builtin_number",
|
|
591
|
+
"is_builtin_obj",
|
|
592
|
+
"is_builtin_scalar",
|
|
593
|
+
"is_dataclass_instance",
|
|
594
|
+
"is_namedtuple_instance",
|
|
595
|
+
"is_typed_dict",
|
|
596
|
+
"isinstance_generic",
|
|
597
|
+
],
|
|
598
|
+
"types.tensor_subclasses": [
|
|
599
|
+
"BoolTensor",
|
|
600
|
+
"BoolTensor0D",
|
|
601
|
+
"BoolTensor1D",
|
|
602
|
+
"BoolTensor2D",
|
|
603
|
+
"BoolTensor3D",
|
|
604
|
+
"ByteTensor",
|
|
605
|
+
"ByteTensor0D",
|
|
606
|
+
"ByteTensor1D",
|
|
607
|
+
"ByteTensor2D",
|
|
608
|
+
"ByteTensor3D",
|
|
609
|
+
"CDoubleTensor",
|
|
610
|
+
"CDoubleTensor0D",
|
|
611
|
+
"CDoubleTensor1D",
|
|
612
|
+
"CDoubleTensor2D",
|
|
613
|
+
"CDoubleTensor3D",
|
|
614
|
+
"CFloatTensor",
|
|
615
|
+
"CFloatTensor0D",
|
|
616
|
+
"CFloatTensor1D",
|
|
617
|
+
"CFloatTensor2D",
|
|
618
|
+
"CFloatTensor3D",
|
|
619
|
+
"CharTensor",
|
|
620
|
+
"CharTensor0D",
|
|
621
|
+
"CharTensor1D",
|
|
622
|
+
"CharTensor2D",
|
|
623
|
+
"CharTensor3D",
|
|
624
|
+
"ComplexFloatingTensor",
|
|
625
|
+
"ComplexFloatingTensor0D",
|
|
626
|
+
"ComplexFloatingTensor1D",
|
|
627
|
+
"ComplexFloatingTensor2D",
|
|
628
|
+
"ComplexFloatingTensor3D",
|
|
629
|
+
"DoubleTensor",
|
|
630
|
+
"DoubleTensor0D",
|
|
631
|
+
"DoubleTensor1D",
|
|
632
|
+
"DoubleTensor2D",
|
|
633
|
+
"DoubleTensor3D",
|
|
634
|
+
"FloatingTensor",
|
|
635
|
+
"FloatingTensor0D",
|
|
636
|
+
"FloatingTensor1D",
|
|
637
|
+
"FloatingTensor2D",
|
|
638
|
+
"FloatingTensor3D",
|
|
639
|
+
"FloatTensor",
|
|
640
|
+
"FloatTensor0D",
|
|
641
|
+
"FloatTensor1D",
|
|
642
|
+
"FloatTensor2D",
|
|
643
|
+
"FloatTensor3D",
|
|
644
|
+
"HalfTensor",
|
|
645
|
+
"HalfTensor0D",
|
|
646
|
+
"HalfTensor1D",
|
|
647
|
+
"HalfTensor2D",
|
|
648
|
+
"HalfTensor3D",
|
|
649
|
+
"IntegralTensor",
|
|
650
|
+
"IntegralTensor0D",
|
|
651
|
+
"IntegralTensor1D",
|
|
652
|
+
"IntegralTensor2D",
|
|
653
|
+
"IntegralTensor3D",
|
|
654
|
+
"IntTensor",
|
|
655
|
+
"IntTensor0D",
|
|
656
|
+
"IntTensor1D",
|
|
657
|
+
"IntTensor2D",
|
|
658
|
+
"IntTensor3D",
|
|
659
|
+
"LongTensor",
|
|
660
|
+
"LongTensor0D",
|
|
661
|
+
"LongTensor1D",
|
|
662
|
+
"LongTensor2D",
|
|
663
|
+
"LongTensor3D",
|
|
664
|
+
"RealTensor",
|
|
665
|
+
"RealTensor0D",
|
|
666
|
+
"RealTensor1D",
|
|
667
|
+
"RealTensor2D",
|
|
668
|
+
"RealTensor3D",
|
|
669
|
+
"ShortTensor",
|
|
670
|
+
"ShortTensor0D",
|
|
671
|
+
"ShortTensor1D",
|
|
672
|
+
"ShortTensor2D",
|
|
673
|
+
"ShortTensor3D",
|
|
674
|
+
"SignedIntegerTensor",
|
|
675
|
+
"SignedIntegerTensor0D",
|
|
676
|
+
"SignedIntegerTensor1D",
|
|
677
|
+
"SignedIntegerTensor2D",
|
|
678
|
+
"SignedIntegerTensor3D",
|
|
679
|
+
"Tensor0D",
|
|
680
|
+
"Tensor1D",
|
|
681
|
+
"Tensor2D",
|
|
682
|
+
"Tensor3D",
|
|
683
|
+
"UnsignedIntegerTensor",
|
|
684
|
+
"UnsignedIntegerTensor0D",
|
|
685
|
+
"UnsignedIntegerTensor1D",
|
|
686
|
+
"UnsignedIntegerTensor2D",
|
|
687
|
+
"UnsignedIntegerTensor3D",
|
|
688
|
+
],
|
|
689
|
+
"utils.disk_cache": [
|
|
690
|
+
"register_hooks",
|
|
691
|
+
"disk_cache_call",
|
|
692
|
+
"disk_cache_decorator",
|
|
693
|
+
],
|
|
694
|
+
"utils.rng": ["set_seed"],
|
|
695
|
+
},
|
|
696
|
+
)
|
|
697
|
+
|
|
698
|
+
from pythonwrench.semver import Version
|
|
699
|
+
|
|
700
|
+
version = __version__
|
|
701
|
+
version_info = Version(__version__)
|
|
702
|
+
|
|
703
|
+
del TYPE_CHECKING
|
torchwrench/__main__.py
ADDED