429 const uint64_t *shape,
446 const uint64_t *shape,
1861 const uint32_t *new_shape,
1862 uintptr_t new_shape_len,
1872 const uint32_t *new_shape,
1873 uintptr_t new_shape_len,
1883 const uint32_t *repetitions,
1884 uintptr_t repetitions_len,
1894 const uint32_t *beginning_padding,
1895 uintptr_t beginning_padding_len,
1896 const uint32_t *ending_padding,
1897 uintptr_t ending_padding_len,
1907 const uint32_t *starts,
1908 uintptr_t starts_len,
1909 const uint32_t *sizes,
1910 uintptr_t sizes_len,
1920 uintptr_t inputs_len,
1953 const uint32_t *splits,
1954 uintptr_t splits_len,
1956 uintptr_t outputs_capacity,
1957 uintptr_t *outputs_len);
1966 uint32_t num_splits,
1968 uintptr_t outputs_capacity,
1969 uintptr_t *outputs_len);
1981 uint32_t hidden_size,
1983 uintptr_t outputs_capacity,
1984 uintptr_t *outputs_len);
1996 uint32_t hidden_size,
2009 uint32_t hidden_size,
2011 uintptr_t outputs_capacity,
2012 uintptr_t *outputs_len);
2025 uint32_t hidden_size,
2027 uintptr_t outputs_capacity,
2028 uintptr_t *outputs_len);
2038 uintptr_t outputs_len,
2056 uintptr_t inputs_len,
2058 uintptr_t outputs_len);
2067 uint64_t *dimensions,
2068 uintptr_t dimensions_capacity,
2069 uintptr_t *dimensions_len);
2085 uintptr_t outputs_len,
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_gelu(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the gelu 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_round_even(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the round even 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_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.
void rustnn_operand_destroy(struct RustnnOperand *operand)
Release an [MLOperand] handle.
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_is_infinite(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the is infinite operation using [MLGraphBuilder].
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_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_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_sqrt(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the sqrt 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_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_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_reduce_l1(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce l1 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].
const char * rustnn_last_error_message(void)
Return the last C API error message for this thread.
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_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_log(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the log operation using [MLGraphBuilder].
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_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_sin(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the sin operation using [MLGraphBuilder].
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_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_layer_normalization(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the layer normalization 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_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.
void rustnn_graph_destroy(struct RustnnGraph *graph)
Release an [MLGraph] handle.
void rustnn_operand_descriptor_destroy(struct RustnnOperandDescriptor *descriptor)
Release an [MLOperandDescriptor] handle.
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_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_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_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_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.
struct RustnnOperandDescriptor RustnnOperandDescriptor
Opaque handle wrapping [MLOperandDescriptor].
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].
RustnnBinaryOperation
Implementation detail of the C++ API.
@ RustnnBinaryOperation_Equal
@ RustnnBinaryOperation_GatherNd
@ RustnnBinaryOperation_Mul
@ RustnnBinaryOperation_ConvTranspose2d
@ RustnnBinaryOperation_Min
@ RustnnBinaryOperation_Gather
@ RustnnBinaryOperation_LogicalXor
@ RustnnBinaryOperation_Sub
@ RustnnBinaryOperation_GatherElements
@ RustnnBinaryOperation_NotEqual
@ RustnnBinaryOperation_Conv2d
@ RustnnBinaryOperation_Prelu
@ RustnnBinaryOperation_Pow
@ RustnnBinaryOperation_GreaterOrEqual
@ RustnnBinaryOperation_Div
@ RustnnBinaryOperation_Gemm
@ RustnnBinaryOperation_LogicalAnd
@ RustnnBinaryOperation_LesserOrEqual
@ RustnnBinaryOperation_Lesser
@ RustnnBinaryOperation_Max
@ RustnnBinaryOperation_Greater
@ RustnnBinaryOperation_LogicalOr
@ RustnnBinaryOperation_Add
@ RustnnBinaryOperation_Matmul
RustnnDataType
C representation of [MLOperandDataType].
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_shape(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the shape operation using [MLGraphBuilder].
struct RustnnOperand RustnnOperand
Opaque handle wrapping [MLOperand].
struct RustnnGraphBuilder RustnnGraphBuilder
Opaque handle wrapping [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_is_nan(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the is nan operation using [MLGraphBuilder].
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_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_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_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_sign(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the sign operation using [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.
RustnnBackend
Backend hint for [MLContextOptions], wrapping [Backend].
@ RustnnBackend_Automatic
Select a backend automatically.
@ RustnnBackend_Litert
Use LiteRT.
@ RustnnBackend_Cann
Use CANN.
@ RustnnBackend_Onnx
Use ONNX Runtime.
@ RustnnBackend_Coreml
Use CoreML.
@ RustnnBackend_Trtx
Use TensorRT-RTX.
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].
struct RustnnTensor RustnnTensor
Opaque handle wrapping [MLTensor].
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_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_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.
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_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_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.
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_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_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_hard_sigmoid(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the hard sigmoid operation using [MLGraphBuilder].
struct RustnnContext RustnnContext
Opaque handle wrapping [MLContext].
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].
void rustnn_tensor_destroy(struct RustnnTensor *tensor)
Release an [MLTensor] handle.
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_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_conv2d(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the conv2d operation using [MLGraphBuilder].
RustnnDeviceType
C representation of [DeviceType] for a [BackendDevice] hint.
@ RustnnDeviceType_Npu
NPU device.
@ RustnnDeviceType_Gpu
GPU device.
@ RustnnDeviceType_Cpu
CPU device.
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_transpose(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the transpose operation using [MLGraphBuilder].
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_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_softplus(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the softplus 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_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_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_leaky_relu(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the leaky relu operation using [MLGraphBuilder].
enum RustnnStatus rustnn_context_create(const struct RustnnContextOptions *options, struct RustnnContext **output)
Create an [MLContext].
enum RustnnStatus rustnn_graph_builder_reduce_max(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce max operation using [MLGraphBuilder].
struct RustnnTensorDescriptor RustnnTensorDescriptor
Opaque handle wrapping [MLTensorDescriptor].
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_reduce_min(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce min 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_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_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_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_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.
void rustnn_tensor_descriptor_destroy(struct RustnnTensorDescriptor *descriptor)
Release an [MLTensorDescriptor] handle.
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_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_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_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_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_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_divide(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the divide operation using [MLGraphBuilder].
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].
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].
RustnnUnaryOperation
Implementation detail of the C++ API.
@ RustnnUnaryOperation_Log
@ RustnnUnaryOperation_Tan
@ RustnnUnaryOperation_IsNan
@ RustnnUnaryOperation_LogicalNot
@ RustnnUnaryOperation_IsInfinite
@ RustnnUnaryOperation_AveragePool2d
@ RustnnUnaryOperation_ReduceLogSum
@ RustnnUnaryOperation_Sqrt
@ RustnnUnaryOperation_ReduceSum
@ RustnnUnaryOperation_Relu
@ RustnnUnaryOperation_HardSigmoid
@ RustnnUnaryOperation_ReduceMax
@ RustnnUnaryOperation_Exp
@ RustnnUnaryOperation_HardSwish
@ RustnnUnaryOperation_Tanh
@ RustnnUnaryOperation_Sigmoid
@ RustnnUnaryOperation_Sign
@ RustnnUnaryOperation_Erf
@ RustnnUnaryOperation_Neg
@ RustnnUnaryOperation_ReduceL1
@ RustnnUnaryOperation_Cos
@ RustnnUnaryOperation_MaxPool2d
@ RustnnUnaryOperation_Triangular
@ RustnnUnaryOperation_InstanceNormalization
@ RustnnUnaryOperation_Reverse
@ RustnnUnaryOperation_Squeeze
@ RustnnUnaryOperation_Floor
@ RustnnUnaryOperation_Softplus
@ RustnnUnaryOperation_ReduceMin
@ RustnnUnaryOperation_ReduceLogSumExp
@ RustnnUnaryOperation_Ceil
@ RustnnUnaryOperation_Clamp
@ RustnnUnaryOperation_Reciprocal
@ RustnnUnaryOperation_Softsign
@ RustnnUnaryOperation_Unsqueeze
@ RustnnUnaryOperation_ReduceSumSquare
@ RustnnUnaryOperation_Shape
@ RustnnUnaryOperation_Linear
@ RustnnUnaryOperation_Sin
@ RustnnUnaryOperation_Identity
@ RustnnUnaryOperation_Abs
@ RustnnUnaryOperation_ReduceL2
@ RustnnUnaryOperation_Elu
@ RustnnUnaryOperation_ReduceMean
@ RustnnUnaryOperation_LayerNormalization
@ RustnnUnaryOperation_ReduceProduct
@ RustnnUnaryOperation_Gelu
@ RustnnUnaryOperation_Resample2d
@ RustnnUnaryOperation_RoundEven
@ RustnnUnaryOperation_Transpose
@ RustnnUnaryOperation_LeakyRelu
@ RustnnUnaryOperation_L2Pool2d
struct RustnnContextOptions rustnn_context_options_default(void)
Return the default [MLContextOptions].
enum RustnnStatus rustnn_graph_builder_reciprocal(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reciprocal operation using [MLGraphBuilder].
void rustnn_string_destroy(char *value)
Release a string returned by this C API.
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_relu(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the relu operation using [MLGraphBuilder].
enum RustnnStatus rustnn_context_create_tensor(struct RustnnContext *context, const struct RustnnTensorDescriptor *descriptor, struct RustnnTensor **output)
Allocate an [MLTensor] from an [MLTensorDescriptor].
struct RustnnGraph RustnnGraph
Opaque handle wrapping [MLGraph].
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_create_uncompiled(struct RustnnGraphBuilder **output)
Create an uncompiled [MLGraphBuilder] for graph construction and serialization.
void rustnn_init_logger(void)
Install rustnn's pretty_env_logger global logger if no logger is installed yet.
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_identity(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the identity 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_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_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_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_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_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.
RustnnPowerPreference
C representation of [MLPowerPreference].
@ RustnnPowerPreference_HighPerformance
Prefer high performance.
@ RustnnPowerPreference_LowPower
Prefer low power.
@ RustnnPowerPreference_Default
Use the default power preference.
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_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_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_triangular(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the triangular 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_l2_pool2d(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the l2 pool2d operation using [MLGraphBuilder].
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_resample2d(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the resample2d 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_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_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_hard_swish(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the hard swish operation using [MLGraphBuilder].
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_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_reverse(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reverse 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_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_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_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_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_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_logical_and(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the logical and operation using [MLGraphBuilder].
RustnnStatus
Result of a C API call.
@ RustnnStatus_Error
The wrapped Rust operation returned an error.
@ RustnnStatus_Success
The call completed successfully.
@ RustnnStatus_NullPointer
A required pointer was null.
@ RustnnStatus_InvalidUtf8
A supplied string was not valid UTF-8.
@ RustnnStatus_Panic
The wrapped Rust operation panicked.
@ RustnnStatus_InvalidArgument
A supplied argument was invalid.
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_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_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_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_abs(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the abs operation using [MLGraphBuilder].
void rustnn_graph_builder_destroy(struct RustnnGraphBuilder *builder)
Release an [MLGraphBuilder] handle.
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_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_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_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_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_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_unsqueeze(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the unsqueeze operation using [MLGraphBuilder].
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_create(struct RustnnContext *context, struct RustnnGraphBuilder **output)
Create a runtime-backed [MLGraphBuilder] that exclusively borrows context.
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_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_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_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_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_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_logical_xor(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the logical xor operation using [MLGraphBuilder].
void rustnn_context_destroy(struct RustnnContext *context)
Release an [MLContext] handle.
RustnnTernaryOperation
Implementation detail of the C++ API.
@ RustnnTernaryOperation_ScatterNd
@ RustnnTernaryOperation_Where
@ RustnnTernaryOperation_ScatterElements
@ RustnnTernaryOperation_BatchNormalization
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_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_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_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_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_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_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_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_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_tanh(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the tanh 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_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_linear(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the linear 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_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_exp(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the exp 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].
C representation of [BackendDevice].
uintptr_t device_index
Backend-specific device index.
enum RustnnDeviceType device_type
Device class.
enum RustnnBackend backend
Backend that owns the device.
C representation of [MLContextOptions].
bool accelerated
Whether to prefer an accelerated device.
enum RustnnBackend backend_hint
Automatic corresponds to no Rust backend hint.
struct RustnnOptions rustnn_options
Backend settings used when has_rustnn_options is true.
enum RustnnPowerPreference power_preference
WebNN power preference hint.
bool has_device_hint
Whether device_hint should override automatic device selection.
bool has_rustnn_options
Whether rustnn_options should replace the Rust defaults.
struct RustnnBackendDevice device_hint
Exact device to use when has_device_hint is true.
Name and operand pair used to form [MLNamedOperands].
const struct RustnnOperand * operand
Borrowed operand handle.
const char * name
Null-terminated UTF-8 operand name.
Name and tensor pair used to form [MLNamedTensors].
const struct RustnnTensor * tensor
Borrowed tensor handle.
const char * name
Null-terminated UTF-8 tensor name.
C representation of [MLOperatorOptions] shared by the operations exposed by this ABI.
const char * label
Optional null-terminated UTF-8 label.
C representation of [RustNNOptions].
struct RustnnTrtxOptions trtx
TensorRT-RTX backend settings.
C representation of [TrtxOptions].
bool cuda_graphs
Enable CUDA graph execution.
bool fail_on_cache_miss
Fail if a compiled engine is absent from the cache.
bool runtime_cache
Cache runtime state.
bool engine_caching
Cache compiled engines.