Skip to content

Commit 305b057

Browse files
committed
DimensionTag per_spatial_frame
1 parent 1f356f0 commit 305b057

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

returnn/tf/util/data.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ def __init__(self, kind=Types.Unspecified, description=None,
7171
if dyn_size is not None:
7272
assert not dyn_size_ext
7373
self.dyn_size = dyn_size
74+
# When we have some dynamic size, this dynamic size could be inside a loop (RecLayer),
75+
# and different per each loop frame.
76+
# In that case, we can not access it from outside (except when we accumulate it).
77+
# We expect that the same_base is the dim tag inside the loop, which has this set.
78+
self.per_spatial_frame = None # type: typing.Optional[DimensionTag]
79+
# When we accumulate the dynamic sizes, this results in this dim tag.
80+
# It has same_as set to self.
81+
self.per_spatial_frame_accumulated = None # type: typing.Optional[DimensionTag]
7482

7583
def __repr__(self):
7684
return "DimensionTag{%s}" % self.short_repr()

0 commit comments

Comments
 (0)