Optimizer Checkpoint Schemas #
An optimizer checkpoint is meaningful only for the parameter layout that produced it. This module stores that shared layout: parameter shapes in module order and the corresponding trainability flags. Optimizer-specific codecs validate this schema before installing backend state.
Ordered parameter metadata shared by backend-owned optimizer checkpoints.
- shapes : List Spec.Shape
Parameter shapes in module order.
Whether each corresponding parameter is trainable.
Instances For
def
Runtime.Autograd.Torch.Internal.OptimizerCheckpoint.ParameterSchema.isWellFormed
(schema : ParameterSchema)
:
Whether the shape list and mutability mask describe the same number of parameters.
Instances For
def
Runtime.Autograd.Torch.Internal.OptimizerCheckpoint.ParameterSchema.trainableCount
(schema : ParameterSchema)
:
Number of parameters for which an optimizer state entry is expected.
Instances For
def
Runtime.Autograd.Torch.Internal.OptimizerCheckpoint.ParameterSchema.write
(format : CheckpointIO.Format)
(handle : IO.FS.Handle)
(schema : ParameterSchema)
:
Write the ordered parameter schema for an optimizer-specific checkpoint format.
Instances For
def
Runtime.Autograd.Torch.Internal.OptimizerCheckpoint.ParameterSchema.readAndCheck
(format : CheckpointIO.Format)
(handle : IO.FS.Handle)
(expected : ParameterSchema)
:
Read a parameter schema and reject any difference from the expected module layout.