A compiled model graph loaded onto the NPU.
Load an offline-built graph binary (.cix, produced by the NOE Compiler or
pulled from the CIX AI Model Hub) with load/2, then inspect its input and
output tensors via the descriptor functions. Run inference through
CixP1.Job or the CixP1.run/2 convenience.
Summary
Functions
Number of input tensors the graph expects.
Descriptor for input tensor index (0-based).
All input descriptors, in order.
Loads a compiled graph binary from path into context.
Number of output tensors the graph produces.
Descriptor for output tensor index (0-based).
All output descriptors, in order.
Types
@type descriptor() :: %{ id: non_neg_integer(), size: non_neg_integer(), scale: float(), zero_point: integer(), data_type: atom() | non_neg_integer() }
A tensor descriptor as reported by libnoe.
:id— tensor id within the graph:size— buffer size in bytes:scale/:zero_point— quantization parameters (real = (q - zero_point) * scale):data_type— element type atom (:u8,:s8,:s16,:s32,:f16,:f32, …) or the raw integer for types without an atom mapping
@type t() :: %CixP1.Graph{context: CixP1.Context.t(), resource: reference()}
Functions
@spec input_count(t()) :: {:ok, non_neg_integer()} | {:error, String.t()}
Number of input tensors the graph expects.
@spec input_descriptor(t(), non_neg_integer()) :: {:ok, descriptor()} | {:error, String.t()}
Descriptor for input tensor index (0-based).
@spec input_descriptors(t()) :: {:ok, [descriptor()]} | {:error, String.t()}
All input descriptors, in order.
@spec load(CixP1.Context.t(), Path.t()) :: {:ok, t()} | {:error, String.t()}
Loads a compiled graph binary from path into context.
@spec output_count(t()) :: {:ok, non_neg_integer()} | {:error, String.t()}
Number of output tensors the graph produces.
@spec output_descriptor(t(), non_neg_integer()) :: {:ok, descriptor()} | {:error, String.t()}
Descriptor for output tensor index (0-based).
@spec output_descriptors(t()) :: {:ok, [descriptor()]} | {:error, String.t()}
All output descriptors, in order.