Skip to content

Instantly share code, notes, and snippets.

@cor3ntin
Created June 13, 2020 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cor3ntin/3af7b8790c3282a4b021bd72fa9d32c8 to your computer and use it in GitHub Desktop.
Save cor3ntin/3af7b8790c3282a4b021bd72fa9d32c8 to your computer and use it in GitHub Desktop.
extern "C" {
typedef enum ONNXTensorElementDataType {
ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED,
ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT,
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8,
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8,
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16,
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16,
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32,
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64,
ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING,
ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL,
ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16,
ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE,
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32,
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64,
ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64,
ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128,
ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16
} ONNXTensorElementDataType;
typedef enum ONNXType {
ONNX_TYPE_UNKNOWN,
ONNX_TYPE_TENSOR,
ONNX_TYPE_SEQUENCE,
ONNX_TYPE_MAP,
ONNX_TYPE_OPAQUE,
ONNX_TYPE_SPARSETENSOR,
} ONNXType;
typedef enum OrtLoggingLevel {
ORT_LOGGING_LEVEL_VERBOSE,
ORT_LOGGING_LEVEL_INFO,
ORT_LOGGING_LEVEL_WARNING,
ORT_LOGGING_LEVEL_ERROR,
ORT_LOGGING_LEVEL_FATAL,
} OrtLoggingLevel;
typedef enum OrtErrorCode {
ORT_OK,
ORT_FAIL,
ORT_INVALID_ARGUMENT,
ORT_NO_SUCHFILE,
ORT_NO_MODEL,
ORT_ENGINE_ERROR,
ORT_RUNTIME_EXCEPTION,
ORT_INVALID_PROTOBUF,
ORT_MODEL_LOADED,
ORT_NOT_IMPLEMENTED,
ORT_INVALID_GRAPH,
ORT_EP_FAIL,
} OrtErrorCode;
struct OrtEnv; typedef struct OrtEnv OrtEnv;;
struct OrtStatus; typedef struct OrtStatus OrtStatus;;
struct OrtMemoryInfo; typedef struct OrtMemoryInfo OrtMemoryInfo;;
struct OrtSession; typedef struct OrtSession OrtSession;;
struct OrtValue; typedef struct OrtValue OrtValue;;
struct OrtRunOptions; typedef struct OrtRunOptions OrtRunOptions;;
struct OrtTypeInfo; typedef struct OrtTypeInfo OrtTypeInfo;;
struct OrtTensorTypeAndShapeInfo; typedef struct OrtTensorTypeAndShapeInfo OrtTensorTypeAndShapeInfo;;
struct OrtSessionOptions; typedef struct OrtSessionOptions OrtSessionOptions;;
struct OrtCustomOpDomain; typedef struct OrtCustomOpDomain OrtCustomOpDomain;;
struct OrtMapTypeInfo; typedef struct OrtMapTypeInfo OrtMapTypeInfo;;
struct OrtSequenceTypeInfo; typedef struct OrtSequenceTypeInfo OrtSequenceTypeInfo;;
struct OrtModelMetadata; typedef struct OrtModelMetadata OrtModelMetadata;;
struct OrtThreadPoolParams; typedef struct OrtThreadPoolParams OrtThreadPoolParams;;
struct OrtThreadingOptions; typedef struct OrtThreadingOptions OrtThreadingOptions;;
typedef OrtStatus* OrtStatusPtr;
typedef struct OrtAllocator {
uint32_t version;
void*(* Alloc)(struct OrtAllocator* this_, size_t size);
void(* Free)(struct OrtAllocator* this_, void* p);
const struct OrtMemoryInfo*(* Info)(const struct OrtAllocator* this_);
} OrtAllocator;
typedef void(* OrtLoggingFunction)(
void* param, OrtLoggingLevel severity, const char* category, const char* logid, const char* code_location,
const char* message);
typedef enum GraphOptimizationLevel {
} GraphOptimizationLevel;
typedef enum ExecutionMode {
} ExecutionMode;
struct OrtKernelInfo;
typedef struct OrtKernelInfo OrtKernelInfo;
struct OrtKernelContext;
typedef struct OrtKernelContext OrtKernelContext;
struct OrtCustomOp;
typedef struct OrtCustomOp OrtCustomOp;
typedef enum OrtAllocatorType {
} OrtAllocatorType;
typedef enum OrtMemType {
} OrtMemType;
struct OrtApi;
typedef struct OrtApi OrtApi;
struct OrtApiBase {
const OrtApi*(* GetApi)(uint32_t version)noexcept;
const char*(* GetVersionString)() noexcept;
};
typedef struct OrtApiBase OrtApiBase;
const OrtApiBase* OrtGetApiBase(void) noexcept;
struct OrtApi {
OrtStatus*(* CreateStatus)(OrtErrorCode code, const char* msg)noexcept __attribute__((nonnull));
OrtErrorCode(* GetErrorCode)( const OrtStatus* status) noexcept __attribute__((nonnull));
const char*(* GetErrorMessage)( const OrtStatus* status)noexcept __attribute__((nonnull));
OrtStatusPtr(* CreateEnv)(OrtLoggingLevel default_logging_level, const char* logid, OrtEnv** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* CreateEnvWithCustomLogger)(OrtLoggingFunction logging_function, void* logger_param, OrtLoggingLevel default_warning_level, const char* logid, OrtEnv** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* EnableTelemetryEvents)( const OrtEnv* env) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* DisableTelemetryEvents)( const OrtEnv* env) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* CreateSession)( const OrtEnv* env, const char* model_path, const OrtSessionOptions* options, OrtSession** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CreateSessionFromArray)( const OrtEnv* env, const void* model_data, size_t model_data_length, const OrtSessionOptions* options, OrtSession** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* Run)( OrtSession* sess, const OrtRunOptions* run_options, const char* const* input_names, const OrtValue* const* input, size_t input_len, const char* const* output_names1, size_t output_names_len, OrtValue** output) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CreateSessionOptions)( OrtSessionOptions** options) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SetOptimizedModelFilePath)( OrtSessionOptions* options, const char* optimized_model_filepath) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CloneSessionOptions)( const OrtSessionOptions* in_options, OrtSessionOptions** out_options) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* SetSessionExecutionMode)( OrtSessionOptions* options, ExecutionMode execution_mode) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* EnableProfiling)( OrtSessionOptions* options, const char* profile_file_prefix) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* DisableProfiling)( OrtSessionOptions* options) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* EnableMemPattern)( OrtSessionOptions* options) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* DisableMemPattern)( OrtSessionOptions* options) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* EnableCpuMemArena)( OrtSessionOptions* options) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* DisableCpuMemArena)( OrtSessionOptions* options) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SetSessionLogId)( OrtSessionOptions* options, const char* logid) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SetSessionLogVerbosityLevel)( OrtSessionOptions* options, int session_log_verbosity_level) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SetSessionLogSeverityLevel)( OrtSessionOptions* options, int session_log_severity_level) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SetSessionGraphOptimizationLevel)( OrtSessionOptions* options, GraphOptimizationLevel graph_optimization_level) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* SetIntraOpNumThreads)( OrtSessionOptions* options, int intra_op_num_threads) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SetInterOpNumThreads)( OrtSessionOptions* options, int inter_op_num_threads) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* CreateCustomOpDomain)( const char* domain, OrtCustomOpDomain** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* CustomOpDomain_Add)( OrtCustomOpDomain* custom_op_domain, OrtCustomOp* op) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* AddCustomOpDomain)( OrtSessionOptions* options, OrtCustomOpDomain* custom_op_domain) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* RegisterCustomOpsLibrary)( OrtSessionOptions* options, const char* library_path, void** library_handle) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* SessionGetInputCount)( const OrtSession* sess, size_t* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SessionGetOutputCount)( const OrtSession* sess, size_t* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SessionGetOverridableInitializerCount)( const OrtSession* sess, size_t* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SessionGetInputTypeInfo)( const OrtSession* sess, size_t index, OrtTypeInfo** type_info) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SessionGetOutputTypeInfo)( const OrtSession* sess, size_t index, OrtTypeInfo** type_info) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* SessionGetOverridableInitializerTypeInfo)( const OrtSession* sess, size_t index, OrtTypeInfo** type_info) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* SessionGetInputName)( const OrtSession* sess, size_t index, OrtAllocator* allocator, char** value) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* SessionGetOutputName)( const OrtSession* sess, size_t index, OrtAllocator* allocator, char** value) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* SessionGetOverridableInitializerName)( const OrtSession* sess, size_t index, OrtAllocator* allocator, char** value) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CreateRunOptions)( OrtRunOptions** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* RunOptionsSetRunLogVerbosityLevel)( OrtRunOptions* options, int value) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* RunOptionsSetRunLogSeverityLevel)( OrtRunOptions* options, int value) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* RunOptionsSetRunTag)( OrtRunOptions*, const char* run_tag) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* RunOptionsGetRunLogVerbosityLevel)( const OrtRunOptions* options, int* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* RunOptionsGetRunLogSeverityLevel)( const OrtRunOptions* options, int* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* RunOptionsGetRunTag)( const OrtRunOptions*, const char** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* RunOptionsSetTerminate)( OrtRunOptions* options) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* RunOptionsUnsetTerminate)( OrtRunOptions* options) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* CreateTensorAsOrtValue)( OrtAllocator* allocator, const int64_t* shape, size_t shape_len, ONNXTensorElementDataType type, OrtValue** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CreateTensorWithDataAsOrtValue)( const OrtMemoryInfo* info, void* p_data, size_t p_data_len, const int64_t* shape, size_t shape_len, ONNXTensorElementDataType type, OrtValue** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* IsTensor)( const OrtValue* value, int* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetTensorMutableData)( OrtValue* value, void** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* FillStringTensor)( OrtValue* value, const char* const* s, size_t s_len) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetStringTensorDataLength)( const OrtValue* value, size_t* len) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetStringTensorContent)( const OrtValue* value, void* s, size_t s_len, size_t* offsets, size_t offsets_len) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CastTypeInfoToTensorInfo)( const OrtTypeInfo*, const OrtTensorTypeAndShapeInfo** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* GetOnnxTypeFromTypeInfo)( const OrtTypeInfo*, enum ONNXType* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* CreateTensorTypeAndShapeInfo)( OrtTensorTypeAndShapeInfo** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SetTensorElementType)( OrtTensorTypeAndShapeInfo*, enum ONNXTensorElementDataType type) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SetDimensions)(OrtTensorTypeAndShapeInfo* info, const int64_t* dim_values, size_t dim_count) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetTensorElementType)( const OrtTensorTypeAndShapeInfo*, enum ONNXTensorElementDataType* out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* GetDimensionsCount)( const OrtTensorTypeAndShapeInfo* info, size_t* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetDimensions)( const OrtTensorTypeAndShapeInfo* info, int64_t* dim_values, size_t dim_values_length) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* GetSymbolicDimensions)( const OrtTensorTypeAndShapeInfo* info, const char* dim_params[], size_t dim_params_length) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* GetTensorShapeElementCount)( const OrtTensorTypeAndShapeInfo* info, size_t* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetTensorTypeAndShape)( const OrtValue* value, OrtTensorTypeAndShapeInfo** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetTypeInfo)( const OrtValue* value, OrtTypeInfo** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetValueType)( const OrtValue* value, enum ONNXType* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* CreateMemoryInfo)( const char* name1, enum OrtAllocatorType type, int id1, enum OrtMemType mem_type1, OrtMemoryInfo** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CreateCpuMemoryInfo)(enum OrtAllocatorType type, enum OrtMemType mem_type1, OrtMemoryInfo** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CompareMemoryInfo)( const OrtMemoryInfo* info1, const OrtMemoryInfo* info2, int* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* MemoryInfoGetName)( const OrtMemoryInfo* ptr, const char** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* MemoryInfoGetId)( const OrtMemoryInfo* ptr, int* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* MemoryInfoGetMemType)( const OrtMemoryInfo* ptr, OrtMemType* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* MemoryInfoGetType)( const OrtMemoryInfo* ptr, OrtAllocatorType* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* AllocatorAlloc)( OrtAllocator* ptr, size_t size, void** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* AllocatorFree)( OrtAllocator* ptr, void* p) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* AllocatorGetInfo)( const OrtAllocator* ptr, const struct OrtMemoryInfo** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetAllocatorWithDefaultOptions)( OrtAllocator** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* AddFreeDimensionOverride)( OrtSessionOptions* options, const char* dim_denotation, int64_t dim_value) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* GetValue)( const OrtValue* value, int index, OrtAllocator* allocator, OrtValue** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* GetValueCount)( const OrtValue* value, size_t* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* CreateValue)( const OrtValue* const* in, size_t num_values, enum ONNXType value_type, OrtValue** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CreateOpaqueValue)( const char* domain_name, const char* type_name, const void* data_container, size_t data_container_size, OrtValue** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* GetOpaqueValue)( const char* domain_name, const char* type_name, const OrtValue* in, void* data_container, size_t data_container_size) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* KernelInfoGetAttribute_float)( const OrtKernelInfo* info, const char* name, float* out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* KernelInfoGetAttribute_int64)( const OrtKernelInfo* info, const char* name, int64_t* out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* KernelInfoGetAttribute_string)( const OrtKernelInfo* info, const char* name, char* out, size_t* size) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* KernelContext_GetInputCount)( const OrtKernelContext* context, size_t* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* KernelContext_GetOutputCount)( const OrtKernelContext* context, size_t* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* KernelContext_GetInput)( const OrtKernelContext* context, size_t index, const OrtValue** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* KernelContext_GetOutput)( OrtKernelContext* context, size_t index, const int64_t* dim_values, size_t dim_count, OrtValue** out) noexcept __attribute__((warn_unused_result))
void( * ReleaseEnv)( OrtEnv * input);
void( * ReleaseStatus)( OrtStatus * input);
void( * ReleaseMemoryInfo)( OrtMemoryInfo * input);
void( * ReleaseSession)( OrtSession * input);
void( * ReleaseValue)( OrtValue * input);
void( * ReleaseRunOptions)( OrtRunOptions * input);
void( * ReleaseTypeInfo)( OrtTypeInfo * input);
void( * ReleaseTensorTypeAndShapeInfo)( OrtTensorTypeAndShapeInfo * input);
void( * ReleaseSessionOptions)( OrtSessionOptions * input);
void( * ReleaseCustomOpDomain)( OrtCustomOpDomain * input);
OrtStatusPtr(* GetDenotationFromTypeInfo)( const OrtTypeInfo*, const char** const denotation, size_t* len) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CastTypeInfoToMapTypeInfo)( const OrtTypeInfo* type_info, const OrtMapTypeInfo** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* CastTypeInfoToSequenceTypeInfo)( const OrtTypeInfo* type_info, const OrtSequenceTypeInfo** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* GetMapKeyType)( const OrtMapTypeInfo* map_type_info, enum ONNXTensorElementDataType* out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetMapValueType)( const OrtMapTypeInfo* map_type_info, OrtTypeInfo** type_info) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* GetSequenceElementType)( const OrtSequenceTypeInfo* sequence_type_info, OrtTypeInfo** type_info) noexcept __attribute__((warn_unused_result))
void( * ReleaseMapTypeInfo)( OrtMapTypeInfo * input);
void( * ReleaseSequenceTypeInfo)( OrtSequenceTypeInfo * input);
OrtStatusPtr(* SessionEndProfiling)( OrtSession* sess, OrtAllocator* allocator, char** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* SessionGetModelMetadata)( const OrtSession* sess, OrtModelMetadata** out) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* ModelMetadataGetProducerName)( const OrtModelMetadata* model_metadata, OrtAllocator* allocator, char** value) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* ModelMetadataGetGraphName)( const OrtModelMetadata* model_metadata, OrtAllocator* allocator, char** value) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* ModelMetadataGetDomain)( const OrtModelMetadata* model_metadata, OrtAllocator* allocator, char** value) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* ModelMetadataGetDescription)( const OrtModelMetadata* model_metadata, OrtAllocator* allocator, char** value) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* ModelMetadataLookupCustomMetadataMap)( const OrtModelMetadata* model_metadata, OrtAllocator* allocator, const char* key, char** value) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* ModelMetadataGetVersion)( const OrtModelMetadata* model_metadata, int64_t* value) noexcept __attribute__((warn_unused_result));
void( * ReleaseModelMetadata)( OrtModelMetadata * input);
OrtStatusPtr(* CreateEnvWithGlobalThreadPools)(OrtLoggingLevel default_logging_level, const char* logid, const OrtThreadingOptions* t_options, OrtEnv** out) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* DisablePerSessionThreads)( OrtSessionOptions* options) noexcept __attribute__((warn_unused_result));
OrtStatusPtr(* CreateThreadingOptions)( OrtThreadingOptions** out) noexcept __attribute__((warn_unused_result));
void( * ReleaseThreadingOptions)( OrtThreadingOptions * input);
OrtStatusPtr(* ModelMetadataGetCustomMetadataMapKeys)( const OrtModelMetadata* model_metadata, OrtAllocator* allocator, char*** keys, int64_t* num_keys) noexcept __attribute__((warn_unused_result))
OrtStatusPtr(* AddFreeDimensionOverrideByName)( OrtSessionOptions* options, const char* dim_name, int64_t dim_value) noexcept __attribute__((warn_unused_result))
};
struct OrtCustomOp {
uint32_t version;
void*(* CreateKernel)( struct OrtCustomOp* op, const OrtApi* api,
const OrtKernelInfo* info);
const char*(* GetName)( struct OrtCustomOp* op);
const char*(* GetExecutionProviderType)( struct OrtCustomOp* op);
ONNXTensorElementDataType(* GetInputType)( struct OrtCustomOp* op, size_t index);
size_t(* GetInputTypeCount)( struct OrtCustomOp* op);
ONNXTensorElementDataType(* GetOutputType)( struct OrtCustomOp* op, size_t index);
size_t(* GetOutputTypeCount)( struct OrtCustomOp* op);
void(* KernelCompute)( void* op_kernel, OrtKernelContext* context);
void(* KernelDestroy)( void* op_kernel);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment