ParameterChunk<T>

Models & Types · AiDotNet.Models.Parameters

One concrete, ordered model-state chunk together with the manifest identity and semantic role that govern it.

How It Works

A bare Tensor cannot say whether an optimizer may mutate it. That ambiguity made persistent buffers such as batch-normalization running statistics look like trainable weights whenever the chunked checkpoint surface was compared with the flat state surface. Carrying the role beside the tensor lets serialization enumerate the complete state while an optimizer selects only Trainable chunks.

StableId is durable manifest identity, not a reflection or registration index. Tensor is normally live backing storage. Sources whose native storage is scalar, matrix, tree, or another non-tensor representation may return a payload tensor that is committed through their ordinary SetParameters path.

Constructors

Constructor Summary
ParameterChunk(string stableId, ParameterSlotRole role, Tensor<T> tensor) Creates one role-aware state chunk.

Properties

Property Summary
ParameterSlotRole Role { get; } Whether and how this chunk participates in optimization and persistence.
Tensor<T> Tensor { get; } The concrete payload, in the same scalar order as the flat state surface.
string StableId { get; } The durable path of this chunk in the owning model manifest.