Backwards-compatible functions and attribs for the old
or just rarely used attribs, such that we can save memory for the common case.
- returnn.tensor._tensor_extra.infer_sparse_dim(*, name: str, sparse: bool | None = None, sparse_dim, dim=<class 'returnn.util.basic.NotSpecified'>, **_other_kwargs) Dim | None #
batch_dim_axis (int|None|NotSpecified) – where we add the batch-dim. e.g. shape=(time,…), 0 -> (batch,time,…), 1 -> (time,batch,…). Default is 0. This is normally always set, and a lot of code expects this. However, you can set it to None if this Tensor does not have a batch-dim.
time_dim_axis (int|None|NotSpecified) – where we have the time dim axis, after we added the batch-dim. this is often 1. however, can be None if there is no time-dim.
feature_dim_axis (int|None|NotSpecified) – feature dim axis. by default it’s the last one
shape – including time-dim (can be None). excluding batch-dim. e.g. (time,feat)=(None,128)
dim (int|None|NotSpecified) – feature dimension, shape[-1] if not sparse, otherwise like num_classes