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 graph parameter store from a sequence of layer descriptions.

nodeId assigns graph slots; parameter converts each description to typed weights and bias. Layers are inserted in array order, so the last occurrence of a node id wins.

Instances For

    Convert every weight and bias scalar, preserving the linear layer's dimensions.

    Instances For