rustnn C and C++ API
WebNN graph construction and execution
Loading...
Searching...
No Matches
rustnn.h File Reference
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  RustnnBackendDevice
 C representation of [BackendDevice]. More...
 
struct  RustnnTrtxOptions
 C representation of [TrtxOptions]. More...
 
struct  RustnnOptions
 C representation of [RustNNOptions]. More...
 
struct  RustnnContextOptions
 C representation of [MLContextOptions]. More...
 
struct  RustnnOperatorOptions
 C representation of [MLOperatorOptions] shared by the operations exposed by this ABI. More...
 
struct  RustnnNamedOperand
 Name and operand pair used to form [MLNamedOperands]. More...
 
struct  RustnnNamedTensor
 Name and tensor pair used to form [MLNamedTensors]. More...
 

Typedefs

typedef enum RustnnStatus RustnnStatus
 Result of a C API call.
 
typedef enum RustnnDataType RustnnDataType
 C representation of [MLOperandDataType].
 
typedef enum RustnnPowerPreference RustnnPowerPreference
 C representation of [MLPowerPreference].
 
typedef enum RustnnBackend RustnnBackend
 Backend hint for [MLContextOptions], wrapping [Backend].
 
typedef enum RustnnDeviceType RustnnDeviceType
 C representation of [DeviceType] for a [BackendDevice] hint.
 
typedef enum RustnnUnaryOperation RustnnUnaryOperation
 Implementation detail of the C++ API.
 
typedef enum RustnnBinaryOperation RustnnBinaryOperation
 Implementation detail of the C++ API.
 
typedef enum RustnnTernaryOperation RustnnTernaryOperation
 Implementation detail of the C++ API.
 
typedef struct RustnnContext RustnnContext
 Opaque handle wrapping [MLContext].
 
typedef struct RustnnGraph RustnnGraph
 Opaque handle wrapping [MLGraph].
 
typedef struct RustnnGraphBuilder RustnnGraphBuilder
 Opaque handle wrapping [MLGraphBuilder].
 
typedef struct RustnnOperand RustnnOperand
 Opaque handle wrapping [MLOperand].
 
typedef struct RustnnOperandDescriptor RustnnOperandDescriptor
 Opaque handle wrapping [MLOperandDescriptor].
 
typedef struct RustnnTensor RustnnTensor
 Opaque handle wrapping [MLTensor].
 
typedef struct RustnnTensorDescriptor RustnnTensorDescriptor
 Opaque handle wrapping [MLTensorDescriptor].
 
typedef struct RustnnBackendDevice RustnnBackendDevice
 C representation of [BackendDevice].
 
typedef struct RustnnTrtxOptions RustnnTrtxOptions
 C representation of [TrtxOptions].
 
typedef struct RustnnOptions RustnnOptions
 C representation of [RustNNOptions].
 
typedef struct RustnnContextOptions RustnnContextOptions
 C representation of [MLContextOptions].
 
typedef struct RustnnOperatorOptions RustnnOperatorOptions
 C representation of [MLOperatorOptions] shared by the operations exposed by this ABI.
 
typedef struct RustnnNamedOperand RustnnNamedOperand
 Name and operand pair used to form [MLNamedOperands].
 
typedef struct RustnnNamedTensor RustnnNamedTensor
 Name and tensor pair used to form [MLNamedTensors].
 

Enumerations

enum  RustnnStatus {
  RustnnStatus_Success = 0 , RustnnStatus_NullPointer = 1 , RustnnStatus_InvalidUtf8 = 2 , RustnnStatus_InvalidArgument = 3 ,
  RustnnStatus_Error = 4 , RustnnStatus_Panic = 5
}
 Result of a C API call. More...
 
enum  RustnnDataType {
  RustnnDataType_Float32 = 0 , RustnnDataType_Float16 = 1 , RustnnDataType_Int32 = 2 , RustnnDataType_Uint32 = 3 ,
  RustnnDataType_Int64 = 4 , RustnnDataType_Uint64 = 5 , RustnnDataType_Int8 = 6 , RustnnDataType_Uint8 = 7 ,
  RustnnDataType_Int4 = 8 , RustnnDataType_Uint4 = 9
}
 C representation of [MLOperandDataType]. More...
 
enum  RustnnPowerPreference { RustnnPowerPreference_Default = 0 , RustnnPowerPreference_HighPerformance = 1 , RustnnPowerPreference_LowPower = 2 }
 C representation of [MLPowerPreference]. More...
 
enum  RustnnBackend {
  RustnnBackend_Automatic = 0 , RustnnBackend_Onnx = 1 , RustnnBackend_Trtx = 2 , RustnnBackend_Coreml = 3 ,
  RustnnBackend_Litert = 4 , RustnnBackend_Cann = 5
}
 Backend hint for [MLContextOptions], wrapping [Backend]. More...
 
enum  RustnnDeviceType { RustnnDeviceType_Cpu = 0 , RustnnDeviceType_Gpu = 1 , RustnnDeviceType_Npu = 2 }
 C representation of [DeviceType] for a [BackendDevice] hint. More...
 
enum  RustnnUnaryOperation {
  RustnnUnaryOperation_Abs , RustnnUnaryOperation_RoundEven , RustnnUnaryOperation_Ceil , RustnnUnaryOperation_Cos ,
  RustnnUnaryOperation_Exp , RustnnUnaryOperation_Floor , RustnnUnaryOperation_Gelu , RustnnUnaryOperation_Log ,
  RustnnUnaryOperation_Neg , RustnnUnaryOperation_Relu , RustnnUnaryOperation_Sigmoid , RustnnUnaryOperation_Sin ,
  RustnnUnaryOperation_Sqrt , RustnnUnaryOperation_Tan , RustnnUnaryOperation_Tanh , RustnnUnaryOperation_Erf ,
  RustnnUnaryOperation_Reciprocal , RustnnUnaryOperation_Sign , RustnnUnaryOperation_LogicalNot , RustnnUnaryOperation_Identity ,
  RustnnUnaryOperation_Softplus , RustnnUnaryOperation_Softsign , RustnnUnaryOperation_IsNan , RustnnUnaryOperation_IsInfinite ,
  RustnnUnaryOperation_Shape , RustnnUnaryOperation_Elu , RustnnUnaryOperation_HardSigmoid , RustnnUnaryOperation_HardSwish ,
  RustnnUnaryOperation_LeakyRelu , RustnnUnaryOperation_Linear , RustnnUnaryOperation_Clamp , RustnnUnaryOperation_InstanceNormalization ,
  RustnnUnaryOperation_LayerNormalization , RustnnUnaryOperation_Resample2d , RustnnUnaryOperation_Reverse , RustnnUnaryOperation_Triangular ,
  RustnnUnaryOperation_AveragePool2d , RustnnUnaryOperation_MaxPool2d , RustnnUnaryOperation_L2Pool2d , RustnnUnaryOperation_ReduceSum ,
  RustnnUnaryOperation_ReduceMean , RustnnUnaryOperation_ReduceMax , RustnnUnaryOperation_ReduceMin , RustnnUnaryOperation_ReduceProduct ,
  RustnnUnaryOperation_ReduceL1 , RustnnUnaryOperation_ReduceL2 , RustnnUnaryOperation_ReduceLogSum , RustnnUnaryOperation_ReduceLogSumExp ,
  RustnnUnaryOperation_ReduceSumSquare , RustnnUnaryOperation_Transpose , RustnnUnaryOperation_Squeeze , RustnnUnaryOperation_Unsqueeze
}
 Implementation detail of the C++ API. More...
 
enum  RustnnBinaryOperation {
  RustnnBinaryOperation_Add , RustnnBinaryOperation_Sub , RustnnBinaryOperation_Mul , RustnnBinaryOperation_Div ,
  RustnnBinaryOperation_Pow , RustnnBinaryOperation_Max , RustnnBinaryOperation_Min , RustnnBinaryOperation_Equal ,
  RustnnBinaryOperation_Greater , RustnnBinaryOperation_GreaterOrEqual , RustnnBinaryOperation_Lesser , RustnnBinaryOperation_LesserOrEqual ,
  RustnnBinaryOperation_NotEqual , RustnnBinaryOperation_LogicalAnd , RustnnBinaryOperation_LogicalOr , RustnnBinaryOperation_LogicalXor ,
  RustnnBinaryOperation_Matmul , RustnnBinaryOperation_Gemm , RustnnBinaryOperation_Conv2d , RustnnBinaryOperation_ConvTranspose2d ,
  RustnnBinaryOperation_Gather , RustnnBinaryOperation_GatherElements , RustnnBinaryOperation_GatherNd , RustnnBinaryOperation_Prelu
}
 Implementation detail of the C++ API. More...
 
enum  RustnnTernaryOperation { RustnnTernaryOperation_BatchNormalization , RustnnTernaryOperation_Where , RustnnTernaryOperation_ScatterElements , RustnnTernaryOperation_ScatterNd }
 Implementation detail of the C++ API. More...
 

Functions

const char * rustnn_last_error_message (void)
 Return the last C API error message for this thread.
 
void rustnn_init_logger (void)
 Install rustnn's pretty_env_logger global logger if no logger is installed yet.
 
enum RustnnStatus rustnn_operand_descriptor_create (enum RustnnDataType data_type, const uint64_t *shape, uintptr_t shape_len, struct RustnnOperandDescriptor **output)
 Allocate an [MLOperandDescriptor] from a data type and shape.
 
void rustnn_operand_descriptor_destroy (struct RustnnOperandDescriptor *descriptor)
 Release an [MLOperandDescriptor] handle.
 
enum RustnnStatus rustnn_tensor_descriptor_create (enum RustnnDataType data_type, const uint64_t *shape, uintptr_t shape_len, bool readable, bool writable, struct RustnnTensorDescriptor **output)
 Allocate an [MLTensorDescriptor].
 
void rustnn_tensor_descriptor_destroy (struct RustnnTensorDescriptor *descriptor)
 Release an [MLTensorDescriptor] handle.
 
struct RustnnContextOptions rustnn_context_options_default (void)
 Return the default [MLContextOptions].
 
enum RustnnStatus rustnn_context_create (const struct RustnnContextOptions *options, struct RustnnContext **output)
 Create an [MLContext].
 
void rustnn_context_destroy (struct RustnnContext *context)
 Release an [MLContext] handle.
 
enum RustnnStatus rustnn_context_create_tensor (struct RustnnContext *context, const struct RustnnTensorDescriptor *descriptor, struct RustnnTensor **output)
 Allocate an [MLTensor] from an [MLTensorDescriptor].
 
void rustnn_tensor_destroy (struct RustnnTensor *tensor)
 Release an [MLTensor] handle.
 
enum RustnnStatus rustnn_context_write_tensor (struct RustnnContext *context, const struct RustnnTensor *tensor, const void *data, uintptr_t data_len)
 Copy bytes into an [MLTensor] through [MLContext].
 
enum RustnnStatus rustnn_context_read_tensor (struct RustnnContext *context, const struct RustnnTensor *tensor, void *data, uintptr_t data_len)
 Copy bytes from an [MLTensor] through [MLContext].
 
enum RustnnStatus rustnn_graph_builder_create_uncompiled (struct RustnnGraphBuilder **output)
 Create an uncompiled [MLGraphBuilder] for graph construction and serialization.
 
enum RustnnStatus rustnn_graph_builder_create (struct RustnnContext *context, struct RustnnGraphBuilder **output)
 Create a runtime-backed [MLGraphBuilder] that exclusively borrows context.
 
void rustnn_graph_builder_destroy (struct RustnnGraphBuilder *builder)
 Release an [MLGraphBuilder] handle.
 
void rustnn_operand_destroy (struct RustnnOperand *operand)
 Release an [MLOperand] handle.
 
enum RustnnStatus rustnn_graph_builder_input (struct RustnnGraphBuilder *builder, const char *name, const struct RustnnOperandDescriptor *descriptor, struct RustnnOperand **output)
 Declare a named input [MLOperand] on [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_constant (struct RustnnGraphBuilder *builder, const struct RustnnOperandDescriptor *descriptor, const void *data, uintptr_t data_len, struct RustnnOperand **output)
 Create a constant [MLOperand] from descriptor and bytes on [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_unary (struct RustnnGraphBuilder *builder, enum RustnnUnaryOperation operation, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply a selected unary operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_binary (struct RustnnGraphBuilder *builder, enum RustnnBinaryOperation operation, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply a selected binary operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_ternary (struct RustnnGraphBuilder *builder, enum RustnnTernaryOperation operation, const struct RustnnOperand *first, const struct RustnnOperand *second, const struct RustnnOperand *third, struct RustnnOperand **output)
 Apply a selected ternary operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_unary_with_options (struct RustnnGraphBuilder *builder, enum RustnnUnaryOperation operation, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Implementation detail of the C++ API.
 
enum RustnnStatus rustnn_graph_builder_binary_with_options (struct RustnnGraphBuilder *builder, enum RustnnBinaryOperation operation, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Implementation detail of the C++ API.
 
enum RustnnStatus rustnn_graph_builder_add (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the add operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_subtract (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the subtract operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_multiply (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the multiply operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_divide (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the divide operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_power (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the power operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_maximum (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the maximum operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_minimum (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the minimum operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_equal (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the equal operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_greater (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the greater operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_greater_or_equal (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the greater or equal operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_lesser (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the lesser operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_lesser_or_equal (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the lesser or equal operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_not_equal (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the not equal operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_logical_and (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the logical and operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_logical_or (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the logical or operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_logical_xor (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the logical xor operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_matmul (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the matmul operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_abs (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the abs operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_round_even (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the round even operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_ceil (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the ceil operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_cos (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the cos operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_exp (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the exp operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_floor (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the floor operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_gelu (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the gelu operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_log (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the log operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_negate (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the negate operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_relu (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the relu operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_sigmoid (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the sigmoid operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_sin (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the sin operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_sqrt (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the sqrt operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_tan (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the tan operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_tanh (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the tanh operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_erf (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the erf operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reciprocal (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reciprocal operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_sign (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the sign operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_logical_not (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the logical not operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_identity (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the identity operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_softplus (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the softplus operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_softsign (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the softsign operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_is_nan (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the is nan operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_is_infinite (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the is infinite operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_shape (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the shape operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_add_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the add operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_subtract_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the subtract operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_multiply_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the multiply operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_divide_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the divide operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_power_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the power operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_maximum_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the maximum operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_minimum_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the minimum operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_equal_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the equal operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_greater_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the greater operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_greater_or_equal_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the greater or equal operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_lesser_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the lesser operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_lesser_or_equal_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the lesser or equal operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_not_equal_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the not equal operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_logical_and_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the logical and operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_logical_or_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the logical or operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_logical_xor_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the logical xor operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_matmul_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the matmul operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_abs_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the abs operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_round_even_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the round even operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_ceil_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the ceil operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_cos_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the cos operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_exp_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the exp operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_floor_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the floor operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_gelu_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the gelu operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_log_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the log operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_negate_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the negate operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_relu_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the relu operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_sigmoid_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the sigmoid operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_sin_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the sin operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_sqrt_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the sqrt operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_tan_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the tan operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_tanh_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the tanh operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_erf_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the erf operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_reciprocal_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the reciprocal operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_sign_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the sign operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_logical_not_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the logical not operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_identity_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the identity operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_softplus_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the softplus operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_softsign_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the softsign operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_is_nan_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the is nan operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_is_infinite_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the is infinite operation using [MLGraphBuilder] with a label.
 
enum RustnnStatus rustnn_graph_builder_shape_with_options (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
 Apply the shape operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_elu (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the elu operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_hard_sigmoid (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the hard sigmoid operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_hard_swish (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the hard swish operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_leaky_relu (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the leaky relu operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_linear (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the linear operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_clamp (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the clamp operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_instance_normalization (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the instance normalization operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_layer_normalization (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the layer normalization operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_resample2d (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the resample2d operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reverse (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reverse operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_triangular (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the triangular operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_average_pool2d (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the average pool2d operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_max_pool2d (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the max pool2d operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_l2_pool2d (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the l2 pool2d operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reduce_sum (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reduce sum operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reduce_mean (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reduce mean operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reduce_max (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reduce max operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reduce_min (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reduce min operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reduce_product (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reduce product operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reduce_l1 (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reduce l1 operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reduce_l2 (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reduce l2 operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reduce_log_sum (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reduce log sum operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reduce_log_sum_exp (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reduce log sum exp operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reduce_sum_square (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the reduce sum square operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_transpose (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the transpose operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_squeeze (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the squeeze operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_unsqueeze (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
 Apply the unsqueeze operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_gemm (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the gemm operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_conv2d (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the conv2d operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_conv_transpose2d (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the conv transpose2d operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_gather (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the gather operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_gather_elements (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the gather elements operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_gather_nd (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the gather nd operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_prelu (struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
 Apply the prelu operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_batch_normalization (struct RustnnGraphBuilder *builder, const struct RustnnOperand *first, const struct RustnnOperand *second, const struct RustnnOperand *third, struct RustnnOperand **output)
 Apply the batch normalization operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_where (struct RustnnGraphBuilder *builder, const struct RustnnOperand *first, const struct RustnnOperand *second, const struct RustnnOperand *third, struct RustnnOperand **output)
 Apply the where operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_scatter_elements (struct RustnnGraphBuilder *builder, const struct RustnnOperand *first, const struct RustnnOperand *second, const struct RustnnOperand *third, struct RustnnOperand **output)
 Apply the scatter elements operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_scatter_nd (struct RustnnGraphBuilder *builder, const struct RustnnOperand *first, const struct RustnnOperand *second, const struct RustnnOperand *third, struct RustnnOperand **output)
 Apply the scatter nd operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_arg_min (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, uint32_t axis, struct RustnnOperand **output)
 Apply the arg min operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_arg_max (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, uint32_t axis, struct RustnnOperand **output)
 Apply the arg max operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_cast (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, enum RustnnDataType data_type, struct RustnnOperand **output)
 Apply the cast operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_cumulative_sum (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, uint32_t axis, struct RustnnOperand **output)
 Apply the cumulative sum operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_softmax (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, uint32_t axis, struct RustnnOperand **output)
 Apply the softmax operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_expand (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *new_shape, uintptr_t new_shape_len, struct RustnnOperand **output)
 Apply the expand operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_reshape (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *new_shape, uintptr_t new_shape_len, struct RustnnOperand **output)
 Apply the reshape operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_tile (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *repetitions, uintptr_t repetitions_len, struct RustnnOperand **output)
 Apply the tile operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_pad (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *beginning_padding, uintptr_t beginning_padding_len, const uint32_t *ending_padding, uintptr_t ending_padding_len, struct RustnnOperand **output)
 Apply the pad operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_slice (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *starts, uintptr_t starts_len, const uint32_t *sizes, uintptr_t sizes_len, struct RustnnOperand **output)
 Apply the slice operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_concat (struct RustnnGraphBuilder *builder, const struct RustnnOperand *const *inputs, uintptr_t inputs_len, uint32_t axis, struct RustnnOperand **output)
 Apply the concat operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_quantize_linear (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *scale, const struct RustnnOperand *zero_point, struct RustnnOperand **output)
 Apply the quantize linear operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_dequantize_linear (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *scale, const struct RustnnOperand *zero_point, struct RustnnOperand **output)
 Apply the dequantize linear operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_split (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *splits, uintptr_t splits_len, struct RustnnOperand **outputs, uintptr_t outputs_capacity, uintptr_t *outputs_len)
 Apply the split operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_split_equal (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, uint32_t num_splits, struct RustnnOperand **outputs, uintptr_t outputs_capacity, uintptr_t *outputs_len)
 Apply the split equal operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_gru (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *weight, const struct RustnnOperand *recurrent_weight, uint32_t steps, uint32_t hidden_size, struct RustnnOperand **outputs, uintptr_t outputs_capacity, uintptr_t *outputs_len)
 Apply the gru operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_gru_cell (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *weight, const struct RustnnOperand *recurrent_weight, const struct RustnnOperand *hidden_state, uint32_t hidden_size, struct RustnnOperand **output)
 Apply the gru cell operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_lstm (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *weight, const struct RustnnOperand *recurrent_weight, uint32_t steps, uint32_t hidden_size, struct RustnnOperand **outputs, uintptr_t outputs_capacity, uintptr_t *outputs_len)
 Apply the lstm operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_lstm_cell (struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *weight, const struct RustnnOperand *recurrent_weight, const struct RustnnOperand *hidden_state, const struct RustnnOperand *cell_state, uint32_t hidden_size, struct RustnnOperand **outputs, uintptr_t outputs_capacity, uintptr_t *outputs_len)
 Apply the lstm cell operation using [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_build (struct RustnnGraphBuilder **builder, const struct RustnnNamedOperand *outputs, uintptr_t outputs_len, struct RustnnGraph **graph)
 Compile a runtime-backed [MLGraphBuilder] into an [MLGraph] and consume it, setting builder to null.
 
void rustnn_graph_destroy (struct RustnnGraph *graph)
 Release an [MLGraph] handle.
 
enum RustnnStatus rustnn_context_dispatch (struct RustnnContext *context, struct RustnnGraph *graph, const struct RustnnNamedTensor *inputs, uintptr_t inputs_len, const struct RustnnNamedTensor *outputs, uintptr_t outputs_len)
 Run an [MLGraph] through [MLContext] with named input and output tensors.
 
enum RustnnStatus rustnn_graph_builder_operand_shape (struct RustnnGraphBuilder *builder, const struct RustnnOperand *operand, uint64_t *dimensions, uintptr_t dimensions_capacity, uintptr_t *dimensions_len)
 Copy an [MLOperand] shape from [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_operand_data_type (struct RustnnGraphBuilder *builder, const struct RustnnOperand *operand, enum RustnnDataType *data_type)
 Read an [MLOperand] data type from [MLGraphBuilder].
 
enum RustnnStatus rustnn_graph_builder_webnn_text (const struct RustnnGraphBuilder *builder, const struct RustnnNamedOperand *outputs, uintptr_t outputs_len, char **text)
 Serialize [MLGraphBuilder] output operands as rustnn WebNN text.
 
void rustnn_string_destroy (char *value)
 Release a string returned by this C API.
 

Typedef Documentation

◆ RustnnBackend

Backend hint for [MLContextOptions], wrapping [Backend].

Automatic leaves backend selection to rustnn.

◆ RustnnBackendDevice

C representation of [BackendDevice].

device_index is the ONNX execution-provider device index or TensorRT CUDA device index. It must be zero for the other backends, whose Rust device variants do not carry an index.

◆ RustnnBinaryOperation

Implementation detail of the C++ API.

◆ RustnnContext

typedef struct RustnnContext RustnnContext

Opaque handle wrapping [MLContext].

See WebNN context.

Definition at line 228 of file rustnn.h.

◆ RustnnContextOptions

C representation of [MLContextOptions].

See WebNN context options.

◆ RustnnDataType

C representation of [MLOperandDataType].

See WebNN operand data types.

◆ RustnnDeviceType

C representation of [DeviceType] for a [BackendDevice] hint.

◆ RustnnGraph

typedef struct RustnnGraph RustnnGraph

Opaque handle wrapping [MLGraph].

See WebNN graph.

Definition at line 235 of file rustnn.h.

◆ RustnnGraphBuilder

Opaque handle wrapping [MLGraphBuilder].

See WebNN graph builder.

Definition at line 242 of file rustnn.h.

◆ RustnnNamedOperand

Name and operand pair used to form [MLNamedOperands].

See WebNN named operands.

◆ RustnnNamedTensor

Name and tensor pair used to form [MLNamedTensors].

See WebNN named tensors.

◆ RustnnOperand

typedef struct RustnnOperand RustnnOperand

Opaque handle wrapping [MLOperand].

See WebNN operand.

Definition at line 249 of file rustnn.h.

◆ RustnnOperandDescriptor

Opaque handle wrapping [MLOperandDescriptor].

See WebNN operand descriptor.

Definition at line 256 of file rustnn.h.

◆ RustnnOperatorOptions

C representation of [MLOperatorOptions] shared by the operations exposed by this ABI.

A null label is equivalent to an empty label.

See WebNN operator options.

◆ RustnnOptions

typedef struct RustnnOptions RustnnOptions

C representation of [RustNNOptions].

The other backend option structures in the Rust API are currently empty, so TensorRT is the only member with settings.

◆ RustnnPowerPreference

C representation of [MLPowerPreference].

See WebNN power preference.

◆ RustnnStatus

typedef enum RustnnStatus RustnnStatus

Result of a C API call.

Call rustnn_last_error_message for failure details.

◆ RustnnTensor

typedef struct RustnnTensor RustnnTensor

Opaque handle wrapping [MLTensor].

See WebNN tensor.

Definition at line 263 of file rustnn.h.

◆ RustnnTensorDescriptor

Opaque handle wrapping [MLTensorDescriptor].

See WebNN tensor descriptor.

Definition at line 270 of file rustnn.h.

◆ RustnnTernaryOperation

Implementation detail of the C++ API.

◆ RustnnTrtxOptions

C representation of [TrtxOptions].

◆ RustnnUnaryOperation

Implementation detail of the C++ API.

Enumeration Type Documentation

◆ RustnnBackend

Backend hint for [MLContextOptions], wrapping [Backend].

Automatic leaves backend selection to rustnn.

Enumerator
RustnnBackend_Automatic 

Select a backend automatically.

RustnnBackend_Onnx 

Use ONNX Runtime.

RustnnBackend_Trtx 

Use TensorRT-RTX.

RustnnBackend_Coreml 

Use CoreML.

RustnnBackend_Litert 

Use LiteRT.

RustnnBackend_Cann 

Use CANN.

Definition at line 80 of file rustnn.h.

◆ RustnnBinaryOperation

Implementation detail of the C++ API.

Enumerator
RustnnBinaryOperation_Add 
RustnnBinaryOperation_Sub 
RustnnBinaryOperation_Mul 
RustnnBinaryOperation_Div 
RustnnBinaryOperation_Pow 
RustnnBinaryOperation_Max 
RustnnBinaryOperation_Min 
RustnnBinaryOperation_Equal 
RustnnBinaryOperation_Greater 
RustnnBinaryOperation_GreaterOrEqual 
RustnnBinaryOperation_Lesser 
RustnnBinaryOperation_LesserOrEqual 
RustnnBinaryOperation_NotEqual 
RustnnBinaryOperation_LogicalAnd 
RustnnBinaryOperation_LogicalOr 
RustnnBinaryOperation_LogicalXor 
RustnnBinaryOperation_Matmul 
RustnnBinaryOperation_Gemm 
RustnnBinaryOperation_Conv2d 
RustnnBinaryOperation_ConvTranspose2d 
RustnnBinaryOperation_Gather 
RustnnBinaryOperation_GatherElements 
RustnnBinaryOperation_GatherNd 
RustnnBinaryOperation_Prelu 

Definition at line 186 of file rustnn.h.

◆ RustnnDataType

C representation of [MLOperandDataType].

See WebNN operand data types.

Enumerator
RustnnDataType_Float32 
RustnnDataType_Float16 
RustnnDataType_Int32 
RustnnDataType_Uint32 
RustnnDataType_Int64 
RustnnDataType_Uint64 
RustnnDataType_Int8 
RustnnDataType_Uint8 
RustnnDataType_Int4 
RustnnDataType_Uint4 

Definition at line 43 of file rustnn.h.

◆ RustnnDeviceType

C representation of [DeviceType] for a [BackendDevice] hint.

Enumerator
RustnnDeviceType_Cpu 

CPU device.

RustnnDeviceType_Gpu 

GPU device.

RustnnDeviceType_Npu 

NPU device.

Definition at line 110 of file rustnn.h.

◆ RustnnPowerPreference

C representation of [MLPowerPreference].

See WebNN power preference.

Enumerator
RustnnPowerPreference_Default 

Use the default power preference.

RustnnPowerPreference_HighPerformance 

Prefer high performance.

RustnnPowerPreference_LowPower 

Prefer low power.

Definition at line 61 of file rustnn.h.

◆ RustnnStatus

Result of a C API call.

Call rustnn_last_error_message for failure details.

Enumerator
RustnnStatus_Success 

The call completed successfully.

RustnnStatus_NullPointer 

A required pointer was null.

RustnnStatus_InvalidUtf8 

A supplied string was not valid UTF-8.

RustnnStatus_InvalidArgument 

A supplied argument was invalid.

RustnnStatus_Error 

The wrapped Rust operation returned an error.

RustnnStatus_Panic 

The wrapped Rust operation panicked.

Definition at line 11 of file rustnn.h.

◆ RustnnTernaryOperation

Implementation detail of the C++ API.

Enumerator
RustnnTernaryOperation_BatchNormalization 
RustnnTernaryOperation_Where 
RustnnTernaryOperation_ScatterElements 
RustnnTernaryOperation_ScatterNd 

Definition at line 216 of file rustnn.h.

◆ RustnnUnaryOperation

Implementation detail of the C++ API.

Enumerator
RustnnUnaryOperation_Abs 
RustnnUnaryOperation_RoundEven 
RustnnUnaryOperation_Ceil 
RustnnUnaryOperation_Cos 
RustnnUnaryOperation_Exp 
RustnnUnaryOperation_Floor 
RustnnUnaryOperation_Gelu 
RustnnUnaryOperation_Log 
RustnnUnaryOperation_Neg 
RustnnUnaryOperation_Relu 
RustnnUnaryOperation_Sigmoid 
RustnnUnaryOperation_Sin 
RustnnUnaryOperation_Sqrt 
RustnnUnaryOperation_Tan 
RustnnUnaryOperation_Tanh 
RustnnUnaryOperation_Erf 
RustnnUnaryOperation_Reciprocal 
RustnnUnaryOperation_Sign 
RustnnUnaryOperation_LogicalNot 
RustnnUnaryOperation_Identity 
RustnnUnaryOperation_Softplus 
RustnnUnaryOperation_Softsign 
RustnnUnaryOperation_IsNan 
RustnnUnaryOperation_IsInfinite 
RustnnUnaryOperation_Shape 
RustnnUnaryOperation_Elu 
RustnnUnaryOperation_HardSigmoid 
RustnnUnaryOperation_HardSwish 
RustnnUnaryOperation_LeakyRelu 
RustnnUnaryOperation_Linear 
RustnnUnaryOperation_Clamp 
RustnnUnaryOperation_InstanceNormalization 
RustnnUnaryOperation_LayerNormalization 
RustnnUnaryOperation_Resample2d 
RustnnUnaryOperation_Reverse 
RustnnUnaryOperation_Triangular 
RustnnUnaryOperation_AveragePool2d 
RustnnUnaryOperation_MaxPool2d 
RustnnUnaryOperation_L2Pool2d 
RustnnUnaryOperation_ReduceSum 
RustnnUnaryOperation_ReduceMean 
RustnnUnaryOperation_ReduceMax 
RustnnUnaryOperation_ReduceMin 
RustnnUnaryOperation_ReduceProduct 
RustnnUnaryOperation_ReduceL1 
RustnnUnaryOperation_ReduceL2 
RustnnUnaryOperation_ReduceLogSum 
RustnnUnaryOperation_ReduceLogSumExp 
RustnnUnaryOperation_ReduceSumSquare 
RustnnUnaryOperation_Transpose 
RustnnUnaryOperation_Squeeze 
RustnnUnaryOperation_Unsqueeze 

Definition at line 128 of file rustnn.h.

Function Documentation

◆ rustnn_context_create()

enum RustnnStatus rustnn_context_create ( const struct RustnnContextOptions *  options,
struct RustnnContext **  output 
)

Create an [MLContext].

A null options pointer uses the default WebNN hints.

See WebNN specification.

◆ rustnn_context_create_tensor()

enum RustnnStatus rustnn_context_create_tensor ( struct RustnnContext *  context,
const struct RustnnTensorDescriptor *  descriptor,
struct RustnnTensor **  output 
)

Allocate an [MLTensor] from an [MLTensorDescriptor].

See WebNN specification.

◆ rustnn_context_destroy()

void rustnn_context_destroy ( struct RustnnContext *  context)

Release an [MLContext] handle.

A null pointer is accepted.

See WebNN specification.

◆ rustnn_context_dispatch()

enum RustnnStatus rustnn_context_dispatch ( struct RustnnContext *  context,
struct RustnnGraph *  graph,
const struct RustnnNamedTensor *  inputs,
uintptr_t  inputs_len,
const struct RustnnNamedTensor *  outputs,
uintptr_t  outputs_len 
)

Run an [MLGraph] through [MLContext] with named input and output tensors.

See WebNN specification.

◆ rustnn_context_options_default()

struct RustnnContextOptions rustnn_context_options_default ( void  )

Return the default [MLContextOptions].

See WebNN specification.

◆ rustnn_context_read_tensor()

enum RustnnStatus rustnn_context_read_tensor ( struct RustnnContext *  context,
const struct RustnnTensor *  tensor,
void *  data,
uintptr_t  data_len 
)

Copy bytes from an [MLTensor] through [MLContext].

See WebNN specification.

◆ rustnn_context_write_tensor()

enum RustnnStatus rustnn_context_write_tensor ( struct RustnnContext *  context,
const struct RustnnTensor *  tensor,
const void *  data,
uintptr_t  data_len 
)

Copy bytes into an [MLTensor] through [MLContext].

See WebNN specification.

◆ rustnn_graph_builder_abs()

enum RustnnStatus rustnn_graph_builder_abs ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the abs operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_abs_with_options()

enum RustnnStatus rustnn_graph_builder_abs_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the abs operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_add()

enum RustnnStatus rustnn_graph_builder_add ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the add operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_add_with_options()

enum RustnnStatus rustnn_graph_builder_add_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the add operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_arg_max()

enum RustnnStatus rustnn_graph_builder_arg_max ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
uint32_t  axis,
struct RustnnOperand **  output 
)

Apply the arg max operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_arg_min()

enum RustnnStatus rustnn_graph_builder_arg_min ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
uint32_t  axis,
struct RustnnOperand **  output 
)

Apply the arg min operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_average_pool2d()

enum RustnnStatus rustnn_graph_builder_average_pool2d ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the average pool2d operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_batch_normalization()

enum RustnnStatus rustnn_graph_builder_batch_normalization ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  first,
const struct RustnnOperand *  second,
const struct RustnnOperand *  third,
struct RustnnOperand **  output 
)

Apply the batch normalization operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_binary()

enum RustnnStatus rustnn_graph_builder_binary ( struct RustnnGraphBuilder *  builder,
enum RustnnBinaryOperation  operation,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply a selected binary operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_binary_with_options()

enum RustnnStatus rustnn_graph_builder_binary_with_options ( struct RustnnGraphBuilder *  builder,
enum RustnnBinaryOperation  operation,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Implementation detail of the C++ API.

◆ rustnn_graph_builder_build()

enum RustnnStatus rustnn_graph_builder_build ( struct RustnnGraphBuilder **  builder,
const struct RustnnNamedOperand *  outputs,
uintptr_t  outputs_len,
struct RustnnGraph **  graph 
)

Compile a runtime-backed [MLGraphBuilder] into an [MLGraph] and consume it, setting builder to null.

The originating context must outlive the returned graph. See WebNN specification.

◆ rustnn_graph_builder_cast()

enum RustnnStatus rustnn_graph_builder_cast ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
enum RustnnDataType  data_type,
struct RustnnOperand **  output 
)

Apply the cast operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_ceil()

enum RustnnStatus rustnn_graph_builder_ceil ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the ceil operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_ceil_with_options()

enum RustnnStatus rustnn_graph_builder_ceil_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the ceil operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_clamp()

enum RustnnStatus rustnn_graph_builder_clamp ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the clamp operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_concat()

enum RustnnStatus rustnn_graph_builder_concat ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *const *  inputs,
uintptr_t  inputs_len,
uint32_t  axis,
struct RustnnOperand **  output 
)

Apply the concat operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_constant()

enum RustnnStatus rustnn_graph_builder_constant ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperandDescriptor *  descriptor,
const void *  data,
uintptr_t  data_len,
struct RustnnOperand **  output 
)

Create a constant [MLOperand] from descriptor and bytes on [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_conv2d()

enum RustnnStatus rustnn_graph_builder_conv2d ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the conv2d operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_conv_transpose2d()

enum RustnnStatus rustnn_graph_builder_conv_transpose2d ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the conv transpose2d operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_cos()

enum RustnnStatus rustnn_graph_builder_cos ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the cos operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_cos_with_options()

enum RustnnStatus rustnn_graph_builder_cos_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the cos operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_create()

enum RustnnStatus rustnn_graph_builder_create ( struct RustnnContext *  context,
struct RustnnGraphBuilder **  output 
)

Create a runtime-backed [MLGraphBuilder] that exclusively borrows context.

The context must remain alive and must not be used until this builder is consumed by rustnn_graph_builder_build or destroyed. See WebNN specification.

◆ rustnn_graph_builder_create_uncompiled()

enum RustnnStatus rustnn_graph_builder_create_uncompiled ( struct RustnnGraphBuilder **  output)

Create an uncompiled [MLGraphBuilder] for graph construction and serialization.

◆ rustnn_graph_builder_cumulative_sum()

enum RustnnStatus rustnn_graph_builder_cumulative_sum ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
uint32_t  axis,
struct RustnnOperand **  output 
)

Apply the cumulative sum operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_dequantize_linear()

enum RustnnStatus rustnn_graph_builder_dequantize_linear ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperand *  scale,
const struct RustnnOperand *  zero_point,
struct RustnnOperand **  output 
)

Apply the dequantize linear operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_destroy()

void rustnn_graph_builder_destroy ( struct RustnnGraphBuilder *  builder)

Release an [MLGraphBuilder] handle.

A null pointer is accepted.

◆ rustnn_graph_builder_divide()

enum RustnnStatus rustnn_graph_builder_divide ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the divide operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_divide_with_options()

enum RustnnStatus rustnn_graph_builder_divide_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the divide operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_elu()

enum RustnnStatus rustnn_graph_builder_elu ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the elu operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_equal()

enum RustnnStatus rustnn_graph_builder_equal ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the equal operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_equal_with_options()

enum RustnnStatus rustnn_graph_builder_equal_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the equal operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_erf()

enum RustnnStatus rustnn_graph_builder_erf ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the erf operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_erf_with_options()

enum RustnnStatus rustnn_graph_builder_erf_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the erf operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_exp()

enum RustnnStatus rustnn_graph_builder_exp ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the exp operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_exp_with_options()

enum RustnnStatus rustnn_graph_builder_exp_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the exp operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_expand()

enum RustnnStatus rustnn_graph_builder_expand ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const uint32_t *  new_shape,
uintptr_t  new_shape_len,
struct RustnnOperand **  output 
)

Apply the expand operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_floor()

enum RustnnStatus rustnn_graph_builder_floor ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the floor operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_floor_with_options()

enum RustnnStatus rustnn_graph_builder_floor_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the floor operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_gather()

enum RustnnStatus rustnn_graph_builder_gather ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the gather operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_gather_elements()

enum RustnnStatus rustnn_graph_builder_gather_elements ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the gather elements operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_gather_nd()

enum RustnnStatus rustnn_graph_builder_gather_nd ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the gather nd operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_gelu()

enum RustnnStatus rustnn_graph_builder_gelu ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the gelu operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_gelu_with_options()

enum RustnnStatus rustnn_graph_builder_gelu_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the gelu operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_gemm()

enum RustnnStatus rustnn_graph_builder_gemm ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the gemm operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_greater()

enum RustnnStatus rustnn_graph_builder_greater ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the greater operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_greater_or_equal()

enum RustnnStatus rustnn_graph_builder_greater_or_equal ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the greater or equal operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_greater_or_equal_with_options()

enum RustnnStatus rustnn_graph_builder_greater_or_equal_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the greater or equal operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_greater_with_options()

enum RustnnStatus rustnn_graph_builder_greater_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the greater operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_gru()

enum RustnnStatus rustnn_graph_builder_gru ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperand *  weight,
const struct RustnnOperand *  recurrent_weight,
uint32_t  steps,
uint32_t  hidden_size,
struct RustnnOperand **  outputs,
uintptr_t  outputs_capacity,
uintptr_t *  outputs_len 
)

Apply the gru operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_gru_cell()

enum RustnnStatus rustnn_graph_builder_gru_cell ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperand *  weight,
const struct RustnnOperand *  recurrent_weight,
const struct RustnnOperand *  hidden_state,
uint32_t  hidden_size,
struct RustnnOperand **  output 
)

Apply the gru cell operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_hard_sigmoid()

enum RustnnStatus rustnn_graph_builder_hard_sigmoid ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the hard sigmoid operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_hard_swish()

enum RustnnStatus rustnn_graph_builder_hard_swish ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the hard swish operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_identity()

enum RustnnStatus rustnn_graph_builder_identity ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the identity operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_identity_with_options()

enum RustnnStatus rustnn_graph_builder_identity_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the identity operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_input()

enum RustnnStatus rustnn_graph_builder_input ( struct RustnnGraphBuilder *  builder,
const char *  name,
const struct RustnnOperandDescriptor *  descriptor,
struct RustnnOperand **  output 
)

Declare a named input [MLOperand] on [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_instance_normalization()

enum RustnnStatus rustnn_graph_builder_instance_normalization ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the instance normalization operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_is_infinite()

enum RustnnStatus rustnn_graph_builder_is_infinite ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the is infinite operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_is_infinite_with_options()

enum RustnnStatus rustnn_graph_builder_is_infinite_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the is infinite operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_is_nan()

enum RustnnStatus rustnn_graph_builder_is_nan ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the is nan operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_is_nan_with_options()

enum RustnnStatus rustnn_graph_builder_is_nan_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the is nan operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_l2_pool2d()

enum RustnnStatus rustnn_graph_builder_l2_pool2d ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the l2 pool2d operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_layer_normalization()

enum RustnnStatus rustnn_graph_builder_layer_normalization ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the layer normalization operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_leaky_relu()

enum RustnnStatus rustnn_graph_builder_leaky_relu ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the leaky relu operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_lesser()

enum RustnnStatus rustnn_graph_builder_lesser ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the lesser operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_lesser_or_equal()

enum RustnnStatus rustnn_graph_builder_lesser_or_equal ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the lesser or equal operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_lesser_or_equal_with_options()

enum RustnnStatus rustnn_graph_builder_lesser_or_equal_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the lesser or equal operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_lesser_with_options()

enum RustnnStatus rustnn_graph_builder_lesser_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the lesser operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_linear()

enum RustnnStatus rustnn_graph_builder_linear ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the linear operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_log()

enum RustnnStatus rustnn_graph_builder_log ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the log operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_log_with_options()

enum RustnnStatus rustnn_graph_builder_log_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the log operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_logical_and()

enum RustnnStatus rustnn_graph_builder_logical_and ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the logical and operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_logical_and_with_options()

enum RustnnStatus rustnn_graph_builder_logical_and_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the logical and operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_logical_not()

enum RustnnStatus rustnn_graph_builder_logical_not ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the logical not operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_logical_not_with_options()

enum RustnnStatus rustnn_graph_builder_logical_not_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the logical not operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_logical_or()

enum RustnnStatus rustnn_graph_builder_logical_or ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the logical or operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_logical_or_with_options()

enum RustnnStatus rustnn_graph_builder_logical_or_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the logical or operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_logical_xor()

enum RustnnStatus rustnn_graph_builder_logical_xor ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the logical xor operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_logical_xor_with_options()

enum RustnnStatus rustnn_graph_builder_logical_xor_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the logical xor operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_lstm()

enum RustnnStatus rustnn_graph_builder_lstm ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperand *  weight,
const struct RustnnOperand *  recurrent_weight,
uint32_t  steps,
uint32_t  hidden_size,
struct RustnnOperand **  outputs,
uintptr_t  outputs_capacity,
uintptr_t *  outputs_len 
)

Apply the lstm operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_lstm_cell()

enum RustnnStatus rustnn_graph_builder_lstm_cell ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperand *  weight,
const struct RustnnOperand *  recurrent_weight,
const struct RustnnOperand *  hidden_state,
const struct RustnnOperand *  cell_state,
uint32_t  hidden_size,
struct RustnnOperand **  outputs,
uintptr_t  outputs_capacity,
uintptr_t *  outputs_len 
)

Apply the lstm cell operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_matmul()

enum RustnnStatus rustnn_graph_builder_matmul ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the matmul operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_matmul_with_options()

enum RustnnStatus rustnn_graph_builder_matmul_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the matmul operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_max_pool2d()

enum RustnnStatus rustnn_graph_builder_max_pool2d ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the max pool2d operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_maximum()

enum RustnnStatus rustnn_graph_builder_maximum ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the maximum operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_maximum_with_options()

enum RustnnStatus rustnn_graph_builder_maximum_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the maximum operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_minimum()

enum RustnnStatus rustnn_graph_builder_minimum ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the minimum operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_minimum_with_options()

enum RustnnStatus rustnn_graph_builder_minimum_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the minimum operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_multiply()

enum RustnnStatus rustnn_graph_builder_multiply ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the multiply operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_multiply_with_options()

enum RustnnStatus rustnn_graph_builder_multiply_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the multiply operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_negate()

enum RustnnStatus rustnn_graph_builder_negate ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the negate operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_negate_with_options()

enum RustnnStatus rustnn_graph_builder_negate_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the negate operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_not_equal()

enum RustnnStatus rustnn_graph_builder_not_equal ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the not equal operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_not_equal_with_options()

enum RustnnStatus rustnn_graph_builder_not_equal_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the not equal operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_operand_data_type()

enum RustnnStatus rustnn_graph_builder_operand_data_type ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  operand,
enum RustnnDataType *  data_type 
)

Read an [MLOperand] data type from [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_operand_shape()

enum RustnnStatus rustnn_graph_builder_operand_shape ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  operand,
uint64_t *  dimensions,
uintptr_t  dimensions_capacity,
uintptr_t *  dimensions_len 
)

Copy an [MLOperand] shape from [MLGraphBuilder].

Set dimensions to null and capacity to zero to query the required length.

See WebNN specification.

◆ rustnn_graph_builder_pad()

enum RustnnStatus rustnn_graph_builder_pad ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const uint32_t *  beginning_padding,
uintptr_t  beginning_padding_len,
const uint32_t *  ending_padding,
uintptr_t  ending_padding_len,
struct RustnnOperand **  output 
)

Apply the pad operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_power()

enum RustnnStatus rustnn_graph_builder_power ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the power operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_power_with_options()

enum RustnnStatus rustnn_graph_builder_power_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the power operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_prelu()

enum RustnnStatus rustnn_graph_builder_prelu ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the prelu operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_quantize_linear()

enum RustnnStatus rustnn_graph_builder_quantize_linear ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperand *  scale,
const struct RustnnOperand *  zero_point,
struct RustnnOperand **  output 
)

Apply the quantize linear operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reciprocal()

enum RustnnStatus rustnn_graph_builder_reciprocal ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reciprocal operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reciprocal_with_options()

enum RustnnStatus rustnn_graph_builder_reciprocal_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the reciprocal operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_reduce_l1()

enum RustnnStatus rustnn_graph_builder_reduce_l1 ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reduce l1 operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reduce_l2()

enum RustnnStatus rustnn_graph_builder_reduce_l2 ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reduce l2 operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reduce_log_sum()

enum RustnnStatus rustnn_graph_builder_reduce_log_sum ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reduce log sum operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reduce_log_sum_exp()

enum RustnnStatus rustnn_graph_builder_reduce_log_sum_exp ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reduce log sum exp operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reduce_max()

enum RustnnStatus rustnn_graph_builder_reduce_max ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reduce max operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reduce_mean()

enum RustnnStatus rustnn_graph_builder_reduce_mean ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reduce mean operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reduce_min()

enum RustnnStatus rustnn_graph_builder_reduce_min ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reduce min operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reduce_product()

enum RustnnStatus rustnn_graph_builder_reduce_product ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reduce product operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reduce_sum()

enum RustnnStatus rustnn_graph_builder_reduce_sum ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reduce sum operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reduce_sum_square()

enum RustnnStatus rustnn_graph_builder_reduce_sum_square ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reduce sum square operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_relu()

enum RustnnStatus rustnn_graph_builder_relu ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the relu operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_relu_with_options()

enum RustnnStatus rustnn_graph_builder_relu_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the relu operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_resample2d()

enum RustnnStatus rustnn_graph_builder_resample2d ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the resample2d operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reshape()

enum RustnnStatus rustnn_graph_builder_reshape ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const uint32_t *  new_shape,
uintptr_t  new_shape_len,
struct RustnnOperand **  output 
)

Apply the reshape operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_reverse()

enum RustnnStatus rustnn_graph_builder_reverse ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the reverse operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_round_even()

enum RustnnStatus rustnn_graph_builder_round_even ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the round even operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_round_even_with_options()

enum RustnnStatus rustnn_graph_builder_round_even_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the round even operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_scatter_elements()

enum RustnnStatus rustnn_graph_builder_scatter_elements ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  first,
const struct RustnnOperand *  second,
const struct RustnnOperand *  third,
struct RustnnOperand **  output 
)

Apply the scatter elements operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_scatter_nd()

enum RustnnStatus rustnn_graph_builder_scatter_nd ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  first,
const struct RustnnOperand *  second,
const struct RustnnOperand *  third,
struct RustnnOperand **  output 
)

Apply the scatter nd operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_shape()

enum RustnnStatus rustnn_graph_builder_shape ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the shape operation using [MLGraphBuilder].

This is an extension proposed in https://github.com/webmachinelearning/webnn/pull/945

◆ rustnn_graph_builder_shape_with_options()

enum RustnnStatus rustnn_graph_builder_shape_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the shape operation using [MLGraphBuilder].

This is an extension proposed in https://github.com/webmachinelearning/webnn/pull/945

◆ rustnn_graph_builder_sigmoid()

enum RustnnStatus rustnn_graph_builder_sigmoid ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the sigmoid operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_sigmoid_with_options()

enum RustnnStatus rustnn_graph_builder_sigmoid_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the sigmoid operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_sign()

enum RustnnStatus rustnn_graph_builder_sign ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the sign operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_sign_with_options()

enum RustnnStatus rustnn_graph_builder_sign_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the sign operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_sin()

enum RustnnStatus rustnn_graph_builder_sin ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the sin operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_sin_with_options()

enum RustnnStatus rustnn_graph_builder_sin_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the sin operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_slice()

enum RustnnStatus rustnn_graph_builder_slice ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const uint32_t *  starts,
uintptr_t  starts_len,
const uint32_t *  sizes,
uintptr_t  sizes_len,
struct RustnnOperand **  output 
)

Apply the slice operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_softmax()

enum RustnnStatus rustnn_graph_builder_softmax ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
uint32_t  axis,
struct RustnnOperand **  output 
)

Apply the softmax operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_softplus()

enum RustnnStatus rustnn_graph_builder_softplus ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the softplus operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_softplus_with_options()

enum RustnnStatus rustnn_graph_builder_softplus_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the softplus operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_softsign()

enum RustnnStatus rustnn_graph_builder_softsign ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the softsign operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_softsign_with_options()

enum RustnnStatus rustnn_graph_builder_softsign_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the softsign operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_split()

enum RustnnStatus rustnn_graph_builder_split ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const uint32_t *  splits,
uintptr_t  splits_len,
struct RustnnOperand **  outputs,
uintptr_t  outputs_capacity,
uintptr_t *  outputs_len 
)

Apply the split operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_split_equal()

enum RustnnStatus rustnn_graph_builder_split_equal ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
uint32_t  num_splits,
struct RustnnOperand **  outputs,
uintptr_t  outputs_capacity,
uintptr_t *  outputs_len 
)

Apply the split equal operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_sqrt()

enum RustnnStatus rustnn_graph_builder_sqrt ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the sqrt operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_sqrt_with_options()

enum RustnnStatus rustnn_graph_builder_sqrt_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the sqrt operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_squeeze()

enum RustnnStatus rustnn_graph_builder_squeeze ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the squeeze operation using [MLGraphBuilder].

See WebNN operator emulation.

◆ rustnn_graph_builder_subtract()

enum RustnnStatus rustnn_graph_builder_subtract ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
struct RustnnOperand **  output 
)

Apply the subtract operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_subtract_with_options()

enum RustnnStatus rustnn_graph_builder_subtract_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  lhs,
const struct RustnnOperand *  rhs,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the subtract operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_tan()

enum RustnnStatus rustnn_graph_builder_tan ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the tan operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_tan_with_options()

enum RustnnStatus rustnn_graph_builder_tan_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the tan operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_tanh()

enum RustnnStatus rustnn_graph_builder_tanh ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the tanh operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_tanh_with_options()

enum RustnnStatus rustnn_graph_builder_tanh_with_options ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Apply the tanh operation using [MLGraphBuilder] with a label.

See WebNN specification.

◆ rustnn_graph_builder_ternary()

enum RustnnStatus rustnn_graph_builder_ternary ( struct RustnnGraphBuilder *  builder,
enum RustnnTernaryOperation  operation,
const struct RustnnOperand *  first,
const struct RustnnOperand *  second,
const struct RustnnOperand *  third,
struct RustnnOperand **  output 
)

Apply a selected ternary operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_tile()

enum RustnnStatus rustnn_graph_builder_tile ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
const uint32_t *  repetitions,
uintptr_t  repetitions_len,
struct RustnnOperand **  output 
)

Apply the tile operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_transpose()

enum RustnnStatus rustnn_graph_builder_transpose ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the transpose operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_triangular()

enum RustnnStatus rustnn_graph_builder_triangular ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the triangular operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_unary()

enum RustnnStatus rustnn_graph_builder_unary ( struct RustnnGraphBuilder *  builder,
enum RustnnUnaryOperation  operation,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply a selected unary operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_builder_unary_with_options()

enum RustnnStatus rustnn_graph_builder_unary_with_options ( struct RustnnGraphBuilder *  builder,
enum RustnnUnaryOperation  operation,
const struct RustnnOperand *  input,
const struct RustnnOperatorOptions *  options,
struct RustnnOperand **  output 
)

Implementation detail of the C++ API.

◆ rustnn_graph_builder_unsqueeze()

enum RustnnStatus rustnn_graph_builder_unsqueeze ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  input,
struct RustnnOperand **  output 
)

Apply the unsqueeze operation using [MLGraphBuilder].

See WebNN operator emulation.

◆ rustnn_graph_builder_webnn_text()

enum RustnnStatus rustnn_graph_builder_webnn_text ( const struct RustnnGraphBuilder *  builder,
const struct RustnnNamedOperand *  outputs,
uintptr_t  outputs_len,
char **  text 
)

Serialize [MLGraphBuilder] output operands as rustnn WebNN text.

Release the returned string with rustnn_string_destroy.

◆ rustnn_graph_builder_where()

enum RustnnStatus rustnn_graph_builder_where ( struct RustnnGraphBuilder *  builder,
const struct RustnnOperand *  first,
const struct RustnnOperand *  second,
const struct RustnnOperand *  third,
struct RustnnOperand **  output 
)

Apply the where operation using [MLGraphBuilder].

See WebNN specification.

◆ rustnn_graph_destroy()

void rustnn_graph_destroy ( struct RustnnGraph *  graph)

Release an [MLGraph] handle.

A null pointer is accepted.

See WebNN specification.

◆ rustnn_init_logger()

void rustnn_init_logger ( void  )

Install rustnn's pretty_env_logger global logger if no logger is installed yet.

Set RUST_LOG before calling this function. Repeated calls are safe; calls made after another global logger has already been installed have no effect.

◆ rustnn_last_error_message()

const char * rustnn_last_error_message ( void  )

Return the last C API error message for this thread.

The pointer remains valid until the next error on this thread.

◆ rustnn_operand_descriptor_create()

enum RustnnStatus rustnn_operand_descriptor_create ( enum RustnnDataType  data_type,
const uint64_t *  shape,
uintptr_t  shape_len,
struct RustnnOperandDescriptor **  output 
)

Allocate an [MLOperandDescriptor] from a data type and shape.

See WebNN specification.

◆ rustnn_operand_descriptor_destroy()

void rustnn_operand_descriptor_destroy ( struct RustnnOperandDescriptor *  descriptor)

Release an [MLOperandDescriptor] handle.

A null pointer is accepted.

See WebNN specification.

◆ rustnn_operand_destroy()

void rustnn_operand_destroy ( struct RustnnOperand *  operand)

Release an [MLOperand] handle.

A null pointer is accepted.

◆ rustnn_string_destroy()

void rustnn_string_destroy ( char *  value)

Release a string returned by this C API.

A null pointer is accepted.

◆ rustnn_tensor_descriptor_create()

enum RustnnStatus rustnn_tensor_descriptor_create ( enum RustnnDataType  data_type,
const uint64_t *  shape,
uintptr_t  shape_len,
bool  readable,
bool  writable,
struct RustnnTensorDescriptor **  output 
)

Allocate an [MLTensorDescriptor].

See WebNN specification.

◆ rustnn_tensor_descriptor_destroy()

void rustnn_tensor_descriptor_destroy ( struct RustnnTensorDescriptor *  descriptor)

Release an [MLTensorDescriptor] handle.

A null pointer is accepted.

See WebNN specification.

◆ rustnn_tensor_destroy()

void rustnn_tensor_destroy ( struct RustnnTensor *  tensor)

Release an [MLTensor] handle.

A null pointer is accepted.

See WebNN specification.