returnn 1.20251015.11141__py3-none-any.whl → 1.20251020.105935__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.
Potentially problematic release.
This version of returnn might be problematic. Click here for more details.
- returnn/PKG-INFO +1 -1
- returnn/_setup_info_generated.py +2 -2
- returnn/tensor/_dim_extra.py +36 -24
- {returnn-1.20251015.11141.dist-info → returnn-1.20251020.105935.dist-info}/METADATA +1 -1
- {returnn-1.20251015.11141.dist-info → returnn-1.20251020.105935.dist-info}/RECORD +8 -8
- {returnn-1.20251015.11141.dist-info → returnn-1.20251020.105935.dist-info}/LICENSE +0 -0
- {returnn-1.20251015.11141.dist-info → returnn-1.20251020.105935.dist-info}/WHEEL +0 -0
- {returnn-1.20251015.11141.dist-info → returnn-1.20251020.105935.dist-info}/top_level.txt +0 -0
returnn/PKG-INFO
CHANGED
returnn/_setup_info_generated.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
version = '1.
|
|
2
|
-
long_version = '1.
|
|
1
|
+
version = '1.20251020.105935'
|
|
2
|
+
long_version = '1.20251020.105935+git.d9d5b9f'
|
returnn/tensor/_dim_extra.py
CHANGED
|
@@ -18,6 +18,8 @@ if TYPE_CHECKING:
|
|
|
18
18
|
# just for type hints, otherwise use _d.Dim
|
|
19
19
|
from .dim import Dim
|
|
20
20
|
|
|
21
|
+
from returnn.datasets.util.vocabulary import Vocabulary
|
|
22
|
+
|
|
21
23
|
from . import dim as _d
|
|
22
24
|
from . import tensor as _t
|
|
23
25
|
from . import marked_dim as _m
|
|
@@ -41,54 +43,63 @@ class _DimExtra:
|
|
|
41
43
|
self,
|
|
42
44
|
*,
|
|
43
45
|
dim: Dim,
|
|
44
|
-
kind=DimTypes.Unspecified,
|
|
45
|
-
vocab=None,
|
|
46
|
-
undefined=False,
|
|
47
|
-
special=False,
|
|
48
|
-
auto_generated=False,
|
|
49
|
-
match_priority=0,
|
|
50
|
-
derived_from_tag=None,
|
|
51
|
-
derived_from_op=None,
|
|
52
|
-
batch=None,
|
|
53
|
-
control_flow_ctx=None,
|
|
46
|
+
kind: Entity = DimTypes.Unspecified,
|
|
47
|
+
vocab: Union[None, Dict[str, Any], Vocabulary] = None,
|
|
48
|
+
undefined: bool = False,
|
|
49
|
+
special: bool = False,
|
|
50
|
+
auto_generated: bool = False,
|
|
51
|
+
match_priority: int = 0,
|
|
52
|
+
derived_from_tag: Optional[Dim] = None,
|
|
53
|
+
derived_from_op: Optional[Op] = None,
|
|
54
|
+
batch: Optional[BatchInfo] = None,
|
|
55
|
+
control_flow_ctx: Optional[ControlFlowContext] = None,
|
|
54
56
|
src_data: Optional[_t.Tensor] = None,
|
|
55
57
|
src_axis: Optional[int] = None,
|
|
56
58
|
):
|
|
57
59
|
"""
|
|
58
60
|
:param dim:
|
|
59
|
-
:param
|
|
60
|
-
:param
|
|
61
|
-
:param
|
|
62
|
-
:param
|
|
61
|
+
:param kind:
|
|
62
|
+
:param vocab:
|
|
63
|
+
:param undefined: When this is specified as `None` by the user via `shape`.
|
|
64
|
+
:param special: this can not be a dim tag of :class:`Tensor`.
|
|
63
65
|
But this dim tag also does not match anything except itself.
|
|
64
66
|
So it can be used to represent special placeholders with special meanings like ``single_step``.
|
|
65
|
-
:param
|
|
67
|
+
:param auto_generated:
|
|
66
68
|
This is auto-generated by RETURNN because it was not explicitly specified by the user.
|
|
67
69
|
E.g. for ConvLayer and others.
|
|
68
70
|
This implies certain behavior on equality, such as comparing the description,
|
|
69
71
|
to allow for several independent creations of the dim tag during template construction.
|
|
70
|
-
:param
|
|
72
|
+
:param derived_from_tag:
|
|
71
73
|
Whether this new tag is reduced, down/up sampled, padded etc from this given other tag.
|
|
72
74
|
In situations where dim tags are being matched (Data.get_common_data),
|
|
73
75
|
the behavior is to consider them as equal,
|
|
74
76
|
and assume that the chain of operations (e.g. padding + valid conv) results in the same dim.
|
|
75
|
-
:param
|
|
76
|
-
:param
|
|
77
|
+
:param derived_from_op:
|
|
78
|
+
:param match_priority: when there is ambiguity between multiple dim tags, this value defines the order
|
|
77
79
|
in which the dimension are assigned to their matching counterparts.
|
|
78
80
|
A dimension tag with a higher priority value is assigned first.
|
|
79
81
|
E.g. for a square matrix used for a linear transformation,
|
|
80
82
|
the reduce dim tag should have a higher priority.
|
|
81
|
-
:param
|
|
82
|
-
:param
|
|
83
|
+
:param batch: for batch-dim, or dynamic dims per batch
|
|
84
|
+
:param control_flow_ctx:
|
|
83
85
|
:param src_data:
|
|
84
86
|
:param src_axis:
|
|
85
87
|
"""
|
|
86
88
|
self.dim = dim
|
|
87
89
|
assert kind is None or (isinstance(kind, Entity) and kind in DimTypes.Types)
|
|
88
90
|
self.kind = kind
|
|
91
|
+
if vocab:
|
|
92
|
+
from returnn.datasets.util.vocabulary import Vocabulary
|
|
93
|
+
|
|
94
|
+
if isinstance(vocab, Vocabulary):
|
|
95
|
+
pass
|
|
96
|
+
elif isinstance(vocab, dict):
|
|
97
|
+
vocab = Vocabulary.create_vocab(**vocab)
|
|
98
|
+
else:
|
|
99
|
+
raise TypeError(f"invalid vocab {vocab!r} type {type(vocab)}")
|
|
89
100
|
self.vocab = vocab
|
|
90
|
-
self.same_as
|
|
91
|
-
self.copy_same_as
|
|
101
|
+
self.same_as: Optional[Dim] = None
|
|
102
|
+
self.copy_same_as: Optional[Dim] = None
|
|
92
103
|
self.derived_from_tag = derived_from_tag
|
|
93
104
|
self.derived_from_op = derived_from_op
|
|
94
105
|
if derived_from_op and not derived_from_op.output:
|
|
@@ -116,8 +127,8 @@ class _DimExtra:
|
|
|
116
127
|
self.auto_generated = auto_generated
|
|
117
128
|
# We can have different tag variants per batch info (e.g. with beam), or per control flow ctx.
|
|
118
129
|
# They each have same_as = self. The same_base should have the base (global) batch info.
|
|
119
|
-
self.same_for_batch_ctx
|
|
120
|
-
self.cache_dyn_size_ext_dev
|
|
130
|
+
self.same_for_batch_ctx: Dict[Tuple[BatchInfo, Optional[ControlFlowContext]], Dim] = {}
|
|
131
|
+
self.cache_dyn_size_ext_dev: Dict[str, _t.Tensor] = {} # device -> dyn_size_ext
|
|
121
132
|
self.cache_seq_mask: Dict[Tuple[str, Optional[Tuple[Dim, ...]]], _t.Tensor] = {} # (dev,dim_order) -> seq_mask
|
|
122
133
|
self.cache_dim_math = _CacheDimMath() # op (add,sub,...), operand -> Dim
|
|
123
134
|
|
|
@@ -134,6 +145,7 @@ class _DimExtra:
|
|
|
134
145
|
def __setstate__(self, state):
|
|
135
146
|
self.__dict__.update(state)
|
|
136
147
|
if self.kind is not None:
|
|
148
|
+
# noinspection PyTypeChecker
|
|
137
149
|
self.kind = {v.name: v for v in DimTypes.Types}[self.kind]
|
|
138
150
|
|
|
139
151
|
def __sis_state__(self):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
returnn/PKG-INFO,sha256=
|
|
1
|
+
returnn/PKG-INFO,sha256=d-HPlXh1xUoY5v04CS8o4TAtIlgaext6tyRN2PG_lkQ,5215
|
|
2
2
|
returnn/__init__.py,sha256=biBtRsM0WZ406vShaeH-9WFoqJ8XwTbn6g0EeFJ7l8E,1012
|
|
3
3
|
returnn/__main__.py,sha256=lHyZcu_0yc9f7Vf_Kfdy9PmeU0T76XVXnpalHi5WKro,31740
|
|
4
4
|
returnn/__old_mod_loader__.py,sha256=nvsNY-xELdS_IPNkv66Q9Rmvg4dbGW0-EBRDcCmctos,7654
|
|
5
5
|
returnn/__setup__.py,sha256=22kQn2fh11iPM0hLb2Fy5sLmoU1JGvmDxXRYuRgQkwU,4659
|
|
6
|
-
returnn/_setup_info_generated.py,sha256=
|
|
6
|
+
returnn/_setup_info_generated.py,sha256=TchYaay6OjM0dabh0WfmCarERabRL3tGHUI6Squlpzc,77
|
|
7
7
|
returnn/config.py,sha256=3tmKhB6FnQZaNdtcYsiB61JnEY--iZ2qmJ4yq0b6tE0,29140
|
|
8
8
|
returnn/forward_iface.py,sha256=A_OJiaXsX4MlXQRzST86ylyxSUZbC402PQL1REcqHjM,911
|
|
9
9
|
returnn/learning_rate_control.py,sha256=ZvWryAn_tv9DhV8sh1LV3eE34Yltl3On3mYZAG4hR9s,34684
|
|
@@ -155,7 +155,7 @@ returnn/sprint/extern_interface.py,sha256=l-v1X-Yg0UpTFe7Y3c4FwWOqpSNuv9Oy5EzqlK
|
|
|
155
155
|
returnn/sprint/interface.py,sha256=1j5SB0V8hSW8A5song9ciZtcBnZoKKfNipk9ezOIMuA,36491
|
|
156
156
|
returnn/tensor/README.md,sha256=X6BqcRLrPLPnwF9yR69uqIFrMnNluj9pBkOPHwNgzuo,501
|
|
157
157
|
returnn/tensor/__init__.py,sha256=on6j5PEOQpck50UcsR4nJzJSDmoVy34z1Oq4efv6Ax0,154
|
|
158
|
-
returnn/tensor/_dim_extra.py,sha256=
|
|
158
|
+
returnn/tensor/_dim_extra.py,sha256=sZMW5kwyOWOjUdRos5MIxUZOqgBHF99bu9zX2a4HV0Q,116604
|
|
159
159
|
returnn/tensor/_tensor_extra.py,sha256=1UPNisRAbljkvfMcrEXaPAF-2Dz7AdgC3jAKVVAnAO8,165084
|
|
160
160
|
returnn/tensor/_tensor_mixin_base.py,sha256=H5z86I0NejxrSgMH1c5oXQzBqS6L9HpvP4y7oegBaSc,643
|
|
161
161
|
returnn/tensor/_tensor_op_overloads.py,sha256=HklwuTBjy7mH_665VKaCUdu-oC3aa7Uz1ZQiCz4jeZc,5448
|
|
@@ -254,8 +254,8 @@ returnn/util/sig_proc.py,sha256=Tjz0VOAVyqu2qDCF5HZ1JjALjcFsHcNkcd96WgZeKfE,7265
|
|
|
254
254
|
returnn/util/task_system.py,sha256=y4sMVXQ25Qd2z0rx03uOlXlkE-jbCYC1Sjfn-XlraVU,26003
|
|
255
255
|
returnn/util/train_proc_manager.py,sha256=Pjht28k6uz6BNQ47uW6Gf880iyq5q4wx7P_K2tmoAM8,3266
|
|
256
256
|
returnn/util/watch_memory.py,sha256=BR5P2kvBN6UI81cE0_1WAA6Hd1SByLbBaiDxvLhPOew,4213
|
|
257
|
-
returnn-1.
|
|
258
|
-
returnn-1.
|
|
259
|
-
returnn-1.
|
|
260
|
-
returnn-1.
|
|
261
|
-
returnn-1.
|
|
257
|
+
returnn-1.20251020.105935.dist-info/LICENSE,sha256=ywBD_U2aD4vpuoIgNAsjIGBYydl0tVKll3De0Z8s77c,11041
|
|
258
|
+
returnn-1.20251020.105935.dist-info/METADATA,sha256=d-HPlXh1xUoY5v04CS8o4TAtIlgaext6tyRN2PG_lkQ,5215
|
|
259
|
+
returnn-1.20251020.105935.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
260
|
+
returnn-1.20251020.105935.dist-info/top_level.txt,sha256=Lsn4WZc5Pbfk0-xDQOgnFCxOoqxL4CyeM3N1TFbJncw,8
|
|
261
|
+
returnn-1.20251020.105935.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|