C++ API#
This page contains the API reference for the C++ API. The full API index below can be a bit dense, so we recommend the following tips first:
Please read the C++ Guide for a high-level overview of the C++ API.
The C++ Guide and examples will likely be sufficient to get started with most use cases.
The Key Classes lists the key classes that are most commonly used.
You can go to the Full API Index at the bottom of this page to access the full list of APIs.
We usually group the APIs by files. You can look at the file hierarchy in the full API index and navigate to the specific file to find the APIs in that file.
Header Organization#
The C++ APIs are organized into the following folders:
Folder |
Description |
---|---|
|
Core functionalities that support Function, Any, Object, etc. |
|
Additional container types such as Array, Map, Shape, Tensor, Variant … |
|
Reflection support for function and type information registration. |
|
Extra APIs that are built on top. |
Key Classes#
Class |
Description |
---|---|
Type-erased function that implements the ABI. |
|
Type-erased container for any supported value. |
|
Lightweight view of Any without ownership. |
|
Base class for all heap-allocated FFI objects. |
|
Reference class for objects. |
|
Multi-dimensional tensor with DLPack support. |
|
Tensor shape container. |
|
Dynamic library module that can load exported functions. |
|
String type for FFI. |
|
Byte array type. |
|
Dynamic array container. |
|
Heterogeneous tuple container. |
|
Key-value map container. |
|
Optional value wrapper. |
|
Type-safe union container. |