Eager Operations #
Run an Ops program against the current tape. The instance lives here so evaluation and
recording can use it without importing trainer construction.
@[reducible, inline]
Monad used for the eager Ops instance: read an Internal.EagerSession α and execute in IO.
This is the backend that makes Ops programs execute immediately by mutating a hidden runtime tape.
Instances For
@[instance_reducible]
instance
Runtime.Autograd.Torch.instOpsEagerMOfTensorTransfer
{α : Type}
[TorchLean.Storage α]
[Context α]
[TensorTransfer α]
:
Ops (Internal.EagerM α) α
Ops instance for the eager Torch-style runtime.
This interprets Ops primitives by immediately executing them against the hidden mutable tape in
the current Internal.EagerSession.
def
Runtime.Autograd.Torch.instOpsEagerMOfTensorTransfer.read
{α : Type}
[TorchLean.Storage α]
[TensorTransfer α]
(session : Internal.EagerSession α)
(parameters : Std.HashMap ℕ (AnyParam α))
(storages : Std.HashMap ℕ (Internal.ParameterStorage α))
{ss : List Spec.Shape}
:
RefList (TensorRef α) ss → IO (TorchLean.TensorPack α ss)
Instances For
def
Runtime.Autograd.Torch.instOpsEagerMOfTensorTransfer.write
{α : Type}
[TorchLean.Storage α]
(parameters : Std.HashMap ℕ (AnyParam α))
{ss : List Spec.Shape}
:
RefList (TensorRef α) ss → TorchLean.TensorPack α ss → IO Unit