|
rustnn C and C++ API
WebNN graph construction and execution
|
Owns a backend context for graph compilation, tensors and dispatch. More...
#include <rustnn.hpp>
Public Member Functions | |
| MLContext (const MLContextOptions &options={}) | |
| ~MLContext () | |
| MLContext (const MLContext &)=delete | |
| MLContext & | operator= (const MLContext &)=delete |
| MLContext (MLContext &&other) noexcept | |
| MLContext & | operator= (MLContext &&other) noexcept |
| MLTensor | createTensor (const MLTensorDescriptor &descriptor) |
| Allocate a backend tensor with the descriptor's host access flags. | |
| template<typename T > | |
| void | writeTensor (const MLTensor &tensor, const std::vector< T > &data) |
| Copy raw bytes from data into a writable tensor; T must match its storage. | |
| template<typename T > | |
| std::vector< T > | readTensor (const MLTensor &tensor, std::size_t element_count) |
| Copy a readable tensor into element_count values; T must match its storage. | |
| void | dispatch (MLGraph &graph, const std::vector< std::pair< std::string, const MLTensor * > > &inputs, const std::vector< std::pair< std::string, const MLTensor * > > &outputs) |
| Execute a compiled graph with tensors bound by input and output name. | |
Owns a backend context for graph compilation, tensors and dispatch.
Definition at line 241 of file rustnn.hpp.
|
inlineexplicit |
Definition at line 243 of file rustnn.hpp.
|
inline |
Definition at line 272 of file rustnn.hpp.
|
delete |
|
inlinenoexcept |
Definition at line 276 of file rustnn.hpp.
|
inline |
Allocate a backend tensor with the descriptor's host access flags.
Definition at line 287 of file rustnn.hpp.
|
inline |
Execute a compiled graph with tensors bound by input and output name.
Definition at line 312 of file rustnn.hpp.
Definition at line 278 of file rustnn.hpp.
|
inline |
Copy a readable tensor into element_count values; T must match its storage.
Definition at line 303 of file rustnn.hpp.
|
inline |
Copy raw bytes from data into a writable tensor; T must match its storage.
Definition at line 295 of file rustnn.hpp.