Group Model#

group ov_model_c_api

The definitions & operations about model.

Functions

ov_model_free(ov_model_t *model)#

Release the memory allocated by ov_model_t.

Parameters:

model – A pointer to the ov_model_t to free memory.

ov_model_const_input(const ov_model_t *model, ov_output_const_port_t **input_port)#

Get a const input port of ov_model_t,which only support single input model.

Parameters:
Returns:

Status code of the operation: OK(0) for success.

ov_model_const_input_by_name(const ov_model_t *model, const char *tensor_name, ov_output_const_port_t **input_port)#

Get a const input port of ov_model_t by name.

Parameters:
Returns:

Status code of the operation: OK(0) for success.

ov_model_const_input_by_index(const ov_model_t *model, const size_t index, ov_output_const_port_t **input_port)#

Get a const input port of ov_model_t by port index.

Parameters:
Returns:

Status code of the operation: OK(0) for success.

ov_model_input(const ov_model_t *model, ov_output_port_t **input_port)#

Get single input port of ov_model_t, which only support single input model.

Parameters:
Returns:

Status code of the operation: OK(0) for success.

ov_model_input_by_name(const ov_model_t *model, const char *tensor_name, ov_output_port_t **input_port)#

Get an input port of ov_model_t by name.

Parameters:
  • model – A pointer to the ov_model_t.

  • tensor_name – input tensor name (char *).

  • input_port – A pointer to the ov_output_port_t.

Returns:

Status code of the operation: OK(0) for success.

ov_model_input_by_index(const ov_model_t *model, const size_t index, ov_output_port_t **input_port)#

Get an input port of ov_model_t by port index.

Parameters:
Returns:

Status code of the operation: OK(0) for success.

ov_model_const_output(const ov_model_t *model, ov_output_const_port_t **output_port)#

Get a single const output port of ov_model_t, which only support single output model.

Parameters:
Returns:

Status code of the operation: OK(0) for success.

ov_model_const_output_by_index(const ov_model_t *model, const size_t index, ov_output_const_port_t **output_port)#

Get a const output port of ov_model_t by port index.

Parameters:
Returns:

Status code of the operation: OK(0) for success.

ov_model_const_output_by_name(const ov_model_t *model, const char *tensor_name, ov_output_const_port_t **output_port)#

Get a const output port of ov_model_t by name.

Parameters:
Returns:

Status code of the operation: OK(0) for success.

ov_model_output(const ov_model_t *model, ov_output_port_t **output_port)#

Get a single output port of ov_model_t, which only support single output model.

Parameters:
Returns:

Status code of the operation: OK(0) for success.

ov_model_output_by_index(const ov_model_t *model, const size_t index, ov_output_port_t **output_port)#

Get an output port of ov_model_t by port index.

Parameters:
Returns:

Status code of the operation: OK(0) for success.

ov_model_output_by_name(const ov_model_t *model, const char *tensor_name, ov_output_port_t **output_port)#

Get an output port of ov_model_t by name.

Parameters:
  • model – A pointer to the ov_model_t.

  • tensor_name – output tensor name (char *).

  • output_port – A pointer to the ov_output_port_t.

Returns:

Status code of the operation: OK(0) for success.

ov_model_inputs_size(const ov_model_t *model, size_t *input_size)#

Get the input size of ov_model_t.

Parameters:
  • model – A pointer to the ov_model_t.

  • input_size – the model’s input size.

Returns:

Status code of the operation: OK(0) for success.

ov_model_outputs_size(const ov_model_t *model, size_t *output_size)#

Get the output size of ov_model_t.

Parameters:
  • model – A pointer to the ov_model_t.

  • output_size – the model’s output size.

Returns:

Status code of the operation: OK(0) for success.

ov_model_reshape(const ov_model_t *model, const char **tensor_names, const ov_partial_shape_t *partial_shapes, size_t size)#

Do reshape in model with a list of <name, partial shape>.

Parameters:
  • model – A pointer to the ov_model_t.

  • tensor_names – The list of input tensor names.

  • partialShape – A PartialShape list.

  • size – The item count in the list.

Returns:

Status code of the operation: OK(0) for success.

ov_model_reshape_input_by_name(const ov_model_t *model, const char *tensor_name, const ov_partial_shape_t partial_shape)#

Do reshape in model with partial shape for a specified name.

Parameters:
  • model – A pointer to the ov_model_t.

  • tensor_name – The tensor name of input tensor.

  • partialShape – A PartialShape.

Returns:

Status code of the operation: OK(0) for success.

ov_model_reshape_single_input(const ov_model_t *model, const ov_partial_shape_t partial_shape)#

Do reshape in model for one node(port 0).

Parameters:
  • model – A pointer to the ov_model_t.

  • partialShape – A PartialShape.

Returns:

Status code of the operation: OK(0) for success.

ov_model_reshape_by_port_indexes(const ov_model_t *model, const size_t *port_indexes, const ov_partial_shape_t *partial_shape, size_t size)#

Do reshape in model with a list of <port id, partial shape>.

Parameters:
  • model – A pointer to the ov_model_t.

  • port_indexes – The array of port indexes.

  • partialShape – A PartialShape list.

  • size – The item count in the list.

Returns:

Status code of the operation: OK(0) for success.

ov_model_reshape_by_ports(const ov_model_t *model, const ov_output_port_t **output_ports, const ov_partial_shape_t *partial_shapes, size_t size)#

Do reshape in model with a list of <ov_output_port_t, partial shape>.

Parameters:
  • model – A pointer to the ov_model_t.

  • output_ports – The ov_output_port_t list.

  • partialShape – A PartialShape list.

  • size – The item count in the list.

Returns:

Status code of the operation: OK(0) for success.

ov_model_get_friendly_name(const ov_model_t *model, char **friendly_name)#

Gets the friendly name for a model.

Parameters:
  • model – A pointer to the ov_model_t.

  • friendly_name – the model’s friendly name.

Returns:

Status code of the operation: OK(0) for success.

struct ov_model_t#
#include <ov_model.h>

type define ov_model_t from ov_model