Menoh
Classes | Typedefs | Functions
Model data types and operations

Classes

struct  menoh_model_data
 menoh_model_data contains model parameters and computation graph structure. More...
 

Typedefs

typedef struct menoh_model_datamenoh_model_data_handle
 

Functions

void MENOH_API menoh_delete_model_data (menoh_model_data_handle model_data)
 Model_data delete function. More...
 
menoh_error_code MENOH_API menoh_make_model_data_from_onnx (const char *onnx_filename, menoh_model_data_handle *dst_handle)
 Load onnx file and make model_data. More...
 
menoh_error_code MENOH_API menoh_make_model_data_from_onnx_data_on_memory (const uint8_t *onnx_data, int32_t size, menoh_model_data_handle *dst_handle)
 make model_data from onnx binary data on memory More...
 
menoh_error_code MENOH_API menoh_make_model_data (menoh_model_data_handle *dst_handle)
 Make empty model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_parameter (menoh_model_data_handle model_data, const char *parameter_name, menoh_dtype dtype, int32_t dims_size, const int32_t *dims, void *buffer_handle)
 Add a new parameter in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_new_node (menoh_model_data_handle model_data, const char *op_type)
 Add a new node to model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_input_name_to_current_node (menoh_model_data_handle model_data, const char *input_name)
 Add a new input name to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_output_name_to_current_node (menoh_model_data_handle model_data, const char *output_name)
 Add a new output name to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_attribute_int_to_current_node (menoh_model_data_handle model_data, const char *attribute_name, int32_t value)
 Add a new int attribute to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_attribute_float_to_current_node (menoh_model_data_handle model_data, const char *attribute_name, float value)
 Add a new float attribute to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_attribute_ints_to_current_node (menoh_model_data_handle model_data, const char *attribute_name, int32_t size, const int32_t *value)
 Add a new int array attribute to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_add_attribute_floats_to_current_node (menoh_model_data_handle model_data, const char *attribute_name, int32_t size, const float *value)
 Add a new float array attribute to latest added node in model_data. More...
 
menoh_error_code MENOH_API menoh_model_data_optimize (menoh_model_data_handle model_data, const menoh_variable_profile_table_handle variable_profile_table)
 Optimize function for menoh_model_data. More...
 

Detailed Description

Typedef Documentation

◆ menoh_model_data_handle

Function Documentation

◆ menoh_delete_model_data()

void MENOH_API menoh_delete_model_data ( menoh_model_data_handle  model_data)

Model_data delete function.

Users must call to release memory resources allocated for model_data.

Note
This function can be called after menoh_build_model() function call.

◆ menoh_make_model_data()

menoh_error_code MENOH_API menoh_make_model_data ( menoh_model_data_handle dst_handle)

Make empty model_data.

◆ menoh_make_model_data_from_onnx()

menoh_error_code MENOH_API menoh_make_model_data_from_onnx ( const char *  onnx_filename,
menoh_model_data_handle dst_handle 
)

Load onnx file and make model_data.

◆ menoh_make_model_data_from_onnx_data_on_memory()

menoh_error_code MENOH_API menoh_make_model_data_from_onnx_data_on_memory ( const uint8_t *  onnx_data,
int32_t  size,
menoh_model_data_handle dst_handle 
)

make model_data from onnx binary data on memory

Note
Users can free onnx_data buffer after calling menoh_make_model_data_from_onnx().

◆ menoh_model_data_add_attribute_float_to_current_node()

menoh_error_code MENOH_API menoh_model_data_add_attribute_float_to_current_node ( menoh_model_data_handle  model_data,
const char *  attribute_name,
float  value 
)

Add a new float attribute to latest added node in model_data.

Note
Duplication of attribute_name is not allowed and it throws error.

◆ menoh_model_data_add_attribute_floats_to_current_node()

menoh_error_code MENOH_API menoh_model_data_add_attribute_floats_to_current_node ( menoh_model_data_handle  model_data,
const char *  attribute_name,
int32_t  size,
const float *  value 
)

Add a new float array attribute to latest added node in model_data.

Note
Duplication of attribute_name is not allowed and it throws error.

◆ menoh_model_data_add_attribute_int_to_current_node()

menoh_error_code MENOH_API menoh_model_data_add_attribute_int_to_current_node ( menoh_model_data_handle  model_data,
const char *  attribute_name,
int32_t  value 
)

Add a new int attribute to latest added node in model_data.

Note
Duplication of attribute_name is not allowed and it throws error.

◆ menoh_model_data_add_attribute_ints_to_current_node()

menoh_error_code MENOH_API menoh_model_data_add_attribute_ints_to_current_node ( menoh_model_data_handle  model_data,
const char *  attribute_name,
int32_t  size,
const int32_t *  value 
)

Add a new int array attribute to latest added node in model_data.

Note
Duplication of attribute_name is not allowed and it throws error.

◆ menoh_model_data_add_input_name_to_current_node()

menoh_error_code MENOH_API menoh_model_data_add_input_name_to_current_node ( menoh_model_data_handle  model_data,
const char *  input_name 
)

Add a new input name to latest added node in model_data.

◆ menoh_model_data_add_new_node()

menoh_error_code MENOH_API menoh_model_data_add_new_node ( menoh_model_data_handle  model_data,
const char *  op_type 
)

Add a new node to model_data.

◆ menoh_model_data_add_output_name_to_current_node()

menoh_error_code MENOH_API menoh_model_data_add_output_name_to_current_node ( menoh_model_data_handle  model_data,
const char *  output_name 
)

Add a new output name to latest added node in model_data.

◆ menoh_model_data_add_parameter()

menoh_error_code MENOH_API menoh_model_data_add_parameter ( menoh_model_data_handle  model_data,
const char *  parameter_name,
menoh_dtype  dtype,
int32_t  dims_size,
const int32_t *  dims,
void *  buffer_handle 
)

Add a new parameter in model_data.

Note
Duplication of parameter_name is not allowed and it throws error.

◆ menoh_model_data_optimize()

menoh_error_code MENOH_API menoh_model_data_optimize ( menoh_model_data_handle  model_data,
const menoh_variable_profile_table_handle  variable_profile_table 
)

Optimize function for menoh_model_data.

Note
This function modify given model_data.