concepts.dsl.tensor_state.TensorState#

class TensorState[source]#

Bases: TensorStateBase

A state representation is essentially a mapping from feature names to tensors.

Methods

clone()

clone_internals()

Clone the internals.

extra_state_str_after()

Extra state string.

extra_state_str_before()

Extra state string before the features.

summary_string()

Get a summary string of the state.

Attributes

batch_dims

The number of batchified dimensions.

features

internals

Additional internal information about the state.

__getitem__(name)#
Parameters:

name (str) –

__init__(features=None, batch_dims=0, internals=None)[source]#

Initialize a state.

Parameters:
  • features (Mapping[str, Any] | TensorValueDict | None) – the features of the state.

  • batch_dims (int) – the number of batch dimensions.

  • internals (Dict[str, Any] | None) – the internal state of the state.

__new__(**kwargs)#
clone()[source]#
Return type:

TensorState

clone_internals()[source]#

Clone the internals.

extra_state_str_after()[source]#

Extra state string.

Return type:

str

extra_state_str_before()[source]#

Extra state string before the features.

Return type:

str

summary_string()[source]#

Get a summary string of the state. The main difference between this and __str__ is that this function only formats the shape of intermediate tensors.

Return type:

str

property batch_dims: int#

The number of batchified dimensions. For the basic State, it should be 0.

property features: TensorValueDict#
property internals: Dict[str, Any]#

Additional internal information about the state.