ltx23_load_group

Stream a checkpoint key group into a module

Description

Reads tensors one at a time from an open checkpoint and copies them into the matching parameters/buffers of module. Destination names are derived by map_key; $copy_() handles any dtype/device conversion, so the module may already live on its target device in its target dtype.

Usage

ltx23_load_group(ckpt, keys, module, map_key = identity, verbose = TRUE,
                 gc_every = 50L)

Arguments

  • ckpt: An ltx23_checkpoint.
  • keys: Character vector of checkpoint keys to load (one group from ltx23_split_keys).
  • module: A torch nn_module to populate.
  • map_key: Function mapping a checkpoint key to the module’s parameter/buffer name, or NA to skip the key deliberately.
  • verbose: Logical. Report progress and coverage.
  • gc_every: Integer. Run gc() after this many tensors.

Value

Invisibly, a list with unmapped (checkpoint keys that found no destination), skipped (keys the mapper declined), and unfilled (module parameters/buffers never written). A perfectly loaded group has zero unmapped and zero unfilled.