mojolearn.Mamba1State#
- class mojolearn.Mamba1State(conv_window, h, *, profile_id=1, absolute_position=0, affine_boundary=None, affine_a=None, affine_b=None)[source]#
Bases:
objectRecurrent state of a
Mamba1Block, owned by the caller.Make one with
Mamba1Block.allocate_state; it is all zeros before the first token.forwardandstepupdate the arrays in place. The arrays aremojolearn.Arraywhenallocate_statemade them, or any writable float32 buffer (a NumPy array included) you supply; their bytes can be saved and restored exactly.- Variables:
conv_window (float32 buffer, shape (B, d_inner, 4)) – The last four inputs to the convolution, oldest first.
h (float32 buffer, shape (B, d_inner, 16)) – SSM state.