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
Types
A tensor descriptor as reported by libnoe.
Tensor name and logical shape, read from the .cix model file.
Functions
Number of input tensors the graph expects.
Descriptor for input tensor index (0-based).
All input descriptors, in order.
Name and logical shape of input tensor index (0-based).
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.
Name and logical shape of output tensor index (0-based). See input_shape/2.
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
Tensor name and logical shape, read from the .cix model file.
@type t() :: %CixP1.Graph{ context: CixP1.Context.t(), path: Path.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 input_shape(t(), non_neg_integer()) :: {:ok, shape_info()} | {:error, String.t()}
Name and logical shape of input tensor index (0-based).
Descriptors carry only element type and flat byte size; the shape is read
from the .cix model file on disk, so the file must still be present at the
path the graph was loaded from.
@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.
@spec output_shape(t(), non_neg_integer()) :: {:ok, shape_info()} | {:error, String.t()}
Name and logical shape of output tensor index (0-based). See input_shape/2.