Snakepit.ZeroCopyRef (Snakepit v0.12.0)

Copy Markdown View Source

Opaque handle for zero-copy payloads.

The handle metadata travels through the runtime so adapters can resolve DLPack or Arrow buffers without copying.

Summary

Types

device()

@type device() :: :cpu | :cuda | :mps

kind()

@type kind() :: :dlpack | :arrow

t()

@type t() :: %Snakepit.ZeroCopyRef{
  bytes: non_neg_integer() | nil,
  copy: boolean() | nil,
  device: device() | nil,
  dtype: atom() | String.t() | nil,
  kind: kind(),
  metadata: map() | nil,
  owner: :elixir | :python | nil,
  ref: reference(),
  shape: tuple() | list() | nil
}