coreai¶
CoreAI high-level Python API.
- class coreai.MLAsset¶
Container for a compiled CoreAI model asset.
coreai.runtime¶
CoreAI Runtime.
- final class coreai.runtime.InferenceFunction¶
Represents a function in a model.
- property desc: InferenceFunctionDescriptor¶
The descriptor for this function.
- final class coreai.runtime.NDArray(data: np.ndarray[Any, Any] | torch.Tensor | list[Any], backing: StorageKind = StorageKind.BYTES)¶
Represent a multi-dimensional array.
- property dtype: str¶
The type of scalars in the array.
- classmethod from_descriptor(descriptor: NDArrayDescriptor) Self¶
Allocates an NDArray from an NDArrayDescriptor.
Will have the correct shape, dtype, and alignment.
- numpy() ndarray[Any, Any]¶
Return the array as a NumPy array.
- property shape: tuple[int, ...]¶
The shape of the array.
- property strides: tuple[int, ...]¶
The strides.
Describes the distance between elements across a given dimension.
- class coreai.runtime.SpecializationOptions¶
Options for configuring model specialization.
- property allowed_compute_unit_kinds: list[ComputeUnitKind]¶
Get the allowed compute unit kinds for this specialization.
- classmethod cpu_only() SpecializationOptions¶
Specialization options restricted to CPU only.
- classmethod default() SpecializationOptions¶
Default specialization options.
- classmethod from_preferred_compute_unit_kind(compute_unit_kind: ComputeUnitKind) SpecializationOptions¶
Create specialization options with a specific preferred compute unit kind.
- property preferred_compute_unit_kind: ComputeUnitKind | None¶
Get the preferred compute unit for this specialization.
- with_debug(*, enabled: bool) SpecializationOptions¶
Return a new SpecializationOptions instance with debugging toggled.
- class coreai.runtime.StorageKind(value)¶
Backing buffer type for NDArray.
Python analogue for CoreAI.NDArrayDescriptor.StorageKind.