TorchLean API

NN.Runtime.Autograd.Model.Module.Instantiation

Module Instantiation #

Constructors that instantiate scalar-objective definitions from semantic tensors or storage-first runtime initialization plans.

def Runtime.Autograd.Model.Module.ObjectiveDef.instantiateWith {α β : Type} [TorchLean.Storage α] [TorchLean.Storage β] [Context α] [Torch.TensorTransfer α] {stateShapes inputShapes dataInputShapes : List Spec.Shape} (d : ObjectiveDef β stateShapes inputShapes dataInputShapes) (cast : Floatα) (runtime : Config) :
IO (Objective α β stateShapes inputShapes dataInputShapes)

Instantiate an ObjectiveDef by casting Float initializers to α and choosing a runtime configuration.

This is the most general constructor. The shorter instantiate entrypoint chooses standard runtime settings before calling this function.

Instances For
    def Runtime.Autograd.Model.Module.ObjectiveDef.instantiate {α β : Type} [TorchLean.Storage α] [TorchLean.Storage β] [Context α] [Torch.TensorTransfer α] {stateShapes inputShapes dataInputShapes : List Spec.Shape} (d : ObjectiveDef β stateShapes inputShapes dataInputShapes) (cast : Floatα) (execution : ExecutionMode := Torch.ExecutionMode.eager) :
    IO (Objective α β stateShapes inputShapes dataInputShapes)

    Convenience instantiator that chooses only the execution mode.

    Instances For