Menoh
Classes | Typedefs | Functions
Model types and operations

Classes

struct  menoh_model_builder
 menoh_model_builder is helper for creation of model. More...
 
struct  menoh_model
 menoh_model is the main component to execute model inference. More...
 

Typedefs

typedef struct menoh_model_buildermenoh_model_builder_handle
 
typedef struct menoh_modelmenoh_model_handle
 

Functions

menoh_error_code MENOH_API menoh_make_model_builder (const menoh_variable_profile_table_handle variable_profile_table, menoh_model_builder_handle *dst_handle)
 Factory function for menoh_model_builder. More...
 
void MENOH_API menoh_delete_model_builder (menoh_model_builder_handle model_builder)
 Delete function for model_builder. More...
 
menoh_error_code MENOH_API menoh_model_builder_attach_external_buffer (menoh_model_builder_handle builder, const char *variable_name, void *buffer_handle)
 Attach a buffer which allocated by users. More...
 
menoh_error_code MENOH_API menoh_build_model (const menoh_model_builder_handle builder, const menoh_model_data_handle model_data, const char *backend_name, const char *backend_config, menoh_model_handle *dst_model_handle)
 Factory function for menoh_model. More...
 
void MENOH_API menoh_delete_model (menoh_model_handle model)
 Delete function for model. More...
 
menoh_error_code MENOH_API menoh_model_get_variable_buffer_handle (const menoh_model_handle model, const char *variable_name, void **dst_data)
 Get a buffer handle attached to target variable. More...
 
menoh_error_code MENOH_API menoh_model_get_variable_dtype (const menoh_model_handle model, const char *variable_name, menoh_dtype *dst_dtype)
 Get dtype of target variable. More...
 
menoh_error_code MENOH_API menoh_model_get_variable_dims_size (const menoh_model_handle model, const char *variable_name, int32_t *dst_size)
 Get size of dims of target variable. More...
 
menoh_error_code MENOH_API menoh_model_get_variable_dims_at (const menoh_model_handle model, const char *variable_name, int32_t index, int32_t *dst_size)
 Get an element of dims of target variable specified by index. More...
 
menoh_error_code MENOH_API menoh_model_run (menoh_model_handle model)
 Run model inference. More...
 

Detailed Description

Typedef Documentation

◆ menoh_model_builder_handle

◆ menoh_model_handle

Function Documentation

◆ menoh_build_model()

menoh_error_code MENOH_API menoh_build_model ( const menoh_model_builder_handle  builder,
const menoh_model_data_handle  model_data,
const char *  backend_name,
const char *  backend_config,
menoh_model_handle dst_model_handle 
)

Factory function for menoh_model.

Note
Users can (and should) delete model_data after the model creation by calling menoh_delete_model_data().

◆ menoh_delete_model()

void MENOH_API menoh_delete_model ( menoh_model_handle  model)

Delete function for model.

Users must call to release memory resources allocated for model

◆ menoh_delete_model_builder()

void MENOH_API menoh_delete_model_builder ( menoh_model_builder_handle  model_builder)

Delete function for model_builder.

Users must call to release memory resources allocated for model_builder

◆ menoh_make_model_builder()

menoh_error_code MENOH_API menoh_make_model_builder ( const menoh_variable_profile_table_handle  variable_profile_table,
menoh_model_builder_handle dst_handle 
)

Factory function for menoh_model_builder.

◆ menoh_model_builder_attach_external_buffer()

menoh_error_code MENOH_API menoh_model_builder_attach_external_buffer ( menoh_model_builder_handle  builder,
const char *  variable_name,
void *  buffer_handle 
)

Attach a buffer which allocated by users.

Users can attach a external buffer which they allocated to target variable.

Variables attached no external buffer are attached internal buffers allocated automatically.

Note
Users can get that internal buffer handle by calling menoh_model_get_variable_buffer_handle() later.

◆ menoh_model_get_variable_buffer_handle()

menoh_error_code MENOH_API menoh_model_get_variable_buffer_handle ( const menoh_model_handle  model,
const char *  variable_name,
void **  dst_data 
)

Get a buffer handle attached to target variable.

Users can get a buffer handle attached to target variable.

If that buffer is allocated by users and attached to the variable by calling menoh_model_builder_attach_external_buffer(), returned buffer handle is same to it.

Note
Automatically allocated internal buffers are released automatically so users do not need to (and must not) release them.

◆ menoh_model_get_variable_dims_at()

menoh_error_code MENOH_API menoh_model_get_variable_dims_at ( const menoh_model_handle  model,
const char *  variable_name,
int32_t  index,
int32_t *  dst_size 
)

Get an element of dims of target variable specified by index.

See also
menoh_variable_profile_table_get_dims_at()

◆ menoh_model_get_variable_dims_size()

menoh_error_code MENOH_API menoh_model_get_variable_dims_size ( const menoh_model_handle  model,
const char *  variable_name,
int32_t *  dst_size 
)

Get size of dims of target variable.

See also
menoh_variable_profile_table_get_dims_size()

◆ menoh_model_get_variable_dtype()

menoh_error_code MENOH_API menoh_model_get_variable_dtype ( const menoh_model_handle  model,
const char *  variable_name,
menoh_dtype dst_dtype 
)

Get dtype of target variable.

◆ menoh_model_run()

menoh_error_code MENOH_API menoh_model_run ( menoh_model_handle  model)

Run model inference.

Warning
This function can't be called asynchronously.