TorchLean API

NN.Runtime.PyTorch.Import.CrownParamstore

CrownParamstore #

PyTorch → CROWN ParamStore helpers.

This module is not about JSON parsing; it is about what we do after we have already loaded weights into typed Lean tensors.

Why this exists:

So any real bridge needs a small amount of “wiring code” that:

  1. chooses a node-id scheme (model-specific),
  2. inserts the corresponding (W,b) tensors into the right slots.

These helpers keep NN.Runtime.PyTorch.Import.Core focused on JSON, and so model example loaders can share the same ParamStore-building utilities.

Build a ParamStore Float from a list of linear-layer parameters.

nodeIdOfIndex tells us which graph node id corresponds to the i-th layer in the list. This is the only model-specific decision; the remaining steps are model-agnostic parameter assembly.

Instances For

    Cast linear parameters from Float to an arbitrary scalar type.

    Instances For

      Build a ParamStore α from Float parameters by casting each tensor entry with ofFloat.

      Instances For