LAYER_COUNT

probly.traverse_nn.LAYER_COUNT = <GlobalVariable#0 LAYER_COUNT (default=0)>

A variable that maintains global state across all traversal states.

GlobalVariable extends Variable to provide a mechanism for storing and accessing values that persist globally across different state instances.

The variable is automatically assigned a unique global index during initialization and increments the global counter to ensure uniqueness across all global variables.

Example

>>> counter = GlobalVariable[int]("counter", "Global step counter", 0)
>>> state = State()
>>> current_count = counter.get(state)
>>> new_state = counter.set(state, current_count + 1)