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)
:
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)
:
Convenience instantiator that chooses only the execution mode.