Skip to content

Commit b6555a9

Browse files
committed
Tensor.shape without implicit dims
rwth-i6/returnn#1153
1 parent 75a6fbc commit b6555a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nn/base.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,14 @@ def __deepcopy__(self, memo):
168168
@property
169169
def shape(self) -> Set[Dim]:
170170
"""
171-
:return: shape (set of dims)
171+
:return: shape, as a set of dims.
172+
The order must not play a role
173+
(RETURNN principles: https://github.com/rwth-i6/returnn/wiki/RETURNN-principles),
174+
thus return a set.
175+
Note that we do not include any implicit dims here.
176+
Also see :func:`verify_out_shape` and https://github.com/rwth-i6/returnn/issues/1153.
172177
"""
173-
return self.data.dim_tags_set_implicit
178+
return set(self.data.dim_tags)
174179

175180
@property
176181
def shape_ordered(self) -> Tuple[Dim]:

0 commit comments

Comments
 (0)