CUDA Tensor Storage Bridge #
Adapt the public TensorTransfer capability to dtype-carrying row-major storage owned by the eager
CUDA tape.
def
Runtime.Autograd.Torch.Internal.CudaBridge.toAnyBuffer
{α : Type}
[TorchLean.Storage α]
[TensorTransfer α]
{s : Spec.Shape}
(tensor : TorchLean.Tensor α s)
:
Upload complete configured words or the scalar's native dtype, preserving the tensor's shape.
Instances For
def
Runtime.Autograd.Torch.Internal.CudaBridge.ofBuffer
{α : Type}
[TorchLean.Storage α]
[TensorTransfer α]
{s : Spec.Shape}
(buffer : LibTorch.Buffer)
:
IO (TorchLean.Tensor α s)
Download a buffer with the requested shape, checking its element count.
Instances For
def
Runtime.Autograd.Torch.Internal.CudaBridge.ofAnyBuffer
{α : Type}
[TorchLean.Storage α]
[TensorTransfer α]
(stored : LibTorch.AnyBuffer)
:
IO (Spec.SomeTensor α)
Download a shape-erased buffer through the scalar type's runtime transfer representation.