Skip to main content

RecordState

Derive Macro RecordState 

Source
#[derive(RecordState)]
Expand description

Derive macro for a recordable state (optimizer or learning-rate scheduler), decomposing it into named tensors and scalars for the burnpack format.

Supported field shapes: Tensor<D>, Option<Tensor<D>>, Vec<Tensor<D>>, scalars (usize/isize/u8..u64/i8..i64/f32/f64/bool), Option<scalar>, a nested RecordState, and Option<Nested>. Scalar fields must use a concrete primitive type, not a type alias (e.g. f64, not LearningRate): classification is syntactic, so an alias is treated as a nested state.