pytensor_ml.layers.RecurrentCell.initial_state#

abstractmethod RecurrentCell.initial_state(X)#

Build the state the recurrence starts from, for a sequence X of shape (..., time, n_in).

Carries one value per batch element, so the state’s batch axes are X’s and its dtype is the one step() produces – a float64 sequence through a float32 cell makes a float64 state.

Returns:
statetuple of TensorVariable

Zero-filled state, in the order step() takes and returns it.