Eager Tensor Operations #
PyTorch-style tensor operations recorded on the session's tape. Each one runs the CPU or the CUDA
kernel of the operation, as the session's device selects, and preserves the typed TensorRef
surface.
Tensor ops (eager tape wrappers) #
The following definitions are the eager front-end for the tape constructors. Each one:
- takes the session's tape out of
s.tape, - appends a new node with the CPU constructor (
Runtime.Autograd.Tape.*) or the CUDA one (Runtime.Autograd.LibTorch.Tape.*), as the session's device selects, - writes the extended tape back, and
- returns a fresh
TensorRefpointing to the new node id.
PyTorch comparison: this is the standard eager autograd mechanism (a dynamic tape of ops).
Dispatch an eager operation through its selected CPU or CUDA capsule.
The selected capsule is bound to the matching handler before any implementation runs.
Returning none means the operation has no implementation in this CUDA runtime;
there is no per-operation CPU fallback.
Instances For
Dispatch two recording actions that return node ids.
Both actions remain delayed until execute validates the references and selects a handler,
including any scalar transfers performed by the CUDA action.