-
Notifications
You must be signed in to change notification settings - Fork 133
Open
Description
(I use returnn-common code here but nothing is really specific about returnn-common. nn.zeros
is just ConstantLayer
.)
Consider this code:
x = nn.zeros((dim1, dim2))
x.verify_out_shape({dim1, dim2})
This is correct when dim1
and dim2
are static dims.
Once they are dynamic dims and introduce implicit dims, the verify_out_shape
fails because it does not cover the implicit dims. E.g. when dim1
has a dyn_size_ext
of shape [B]
, then currently you actually need:
x.verify_out_shape({dim1, dim2, batch_dim})
Or:
x.verify_out_shape({dim1, dim2, ImplicitDynSizeDim(batch_dim)})
Because the batch dim is an implicit dim.
Why do we have implicit dims? What are those? They were introduced mostly for CumConcatLayer
. See #391, #589.
Example of such error: rwth-i6/returnn_common#226
See also the earlier discussion on the introduction of out_shape
and verify_out_shape
: #706, #757
Metadata
Metadata
Assignees
Labels
No labels