prev tensor ref for loop, i.e. RecLayer, specifically “prev:…” layer references
- class returnn.tf.frontend_layers.prev_tensor_ref.PrevTensorRef(*, name_ctx: Layer, cur_layer_name_ctx: Layer, data: Tensor)#
Refers to a layer from the previous loop iteration.
dims – the shape, where each dimension is described by a
dtype – e.g. “float32” or “int64”
sparse_dim – when the values are indices into some dimension, this is the dimension. You can also interpret the whole tensor as a sparse representation of a dense one-hot tensor, where this sparse_dim becomes the additional dense dimension.
raw_tensor – the raw tensor, e.g. numpy array, TF tensor, or PyTorch tensor
behavior version just for Tensor. If not specified, and dims is None (old code), it uses version 1. - v1: the old behavior of Data. Specifically, time_dim_axis and feature_dim_axis are used
and automatically inferred when not specified.
v2: time_dim_axis, feature_dim_axis are None by default.
kwargs – see
- classmethod get_prev_ref(*, cur_layer_name_ctx: Layer, initial: Tensor) PrevTensorRef #
Create prev ref.
- name: str#
- dtype: str#
- version: int#