Network¶
Overview¶
Set of functions managing network been read from the IR before loading of it to the device. More…
// global functions
void ie_network_free(ie_network_t** network);
IEStatusCode ie_network_get_name(const ie_network_t* network, char** name);
IEStatusCode ie_network_get_inputs_number(
const ie_network_t* network,
size_t* size_result
);
IEStatusCode ie_network_get_input_name(
const ie_network_t* network,
size_t number,
char** name
);
IEStatusCode ie_network_get_input_precision(
const ie_network_t* network,
const char* input_name,
precision_e* prec_result
);
IEStatusCode ie_network_set_input_precision(
ie_network_t* network,
const char* input_name,
const precision_e p
);
IEStatusCode ie_network_get_input_layout(
const ie_network_t* network,
const char* input_name,
layout_e* layout_result
);
IEStatusCode ie_network_set_input_layout(
ie_network_t* network,
const char* input_name,
const layout_e l
);
IEStatusCode ie_network_get_input_dims(
const ie_network_t* network,
const char* input_name,
dimensions_t* dims_result
);
IEStatusCode ie_network_get_input_resize_algorithm(
const ie_network_t* network,
const char* input_name,
resize_alg_e* resize_alg_result
);
IEStatusCode ie_network_set_input_resize_algorithm(
ie_network_t* network,
const char* input_name,
const resize_alg_e resize_algo
);
IEStatusCode ie_network_get_color_format(
const ie_network_t* network,
const char* input_name,
colorformat_e* colformat_result
);
IEStatusCode ie_network_set_color_format(
ie_network_t* network,
const char* input_name,
const colorformat_e color_format
);
IEStatusCode ie_network_get_input_shapes(
ie_network_t* network,
input_shapes_t* shapes
);
IEStatusCode ie_network_reshape(
ie_network_t* network,
const input_shapes_t shapes
);
IEStatusCode ie_network_get_outputs_number(
const ie_network_t* network,
size_t* size_result
);
IEStatusCode ie_network_get_output_name(
const ie_network_t* network,
const size_t number,
char** name
);
IEStatusCode ie_network_get_output_precision(
const ie_network_t* network,
const char* output_name,
precision_e* prec_result
);
IEStatusCode ie_network_set_output_precision(
ie_network_t* network,
const char* output_name,
const precision_e p
);
IEStatusCode ie_network_get_output_layout(
const ie_network_t* network,
const char* output_name,
layout_e* layout_result
);
IEStatusCode ie_network_set_output_layout(
ie_network_t* network,
const char* output_name,
const layout_e l
);
IEStatusCode ie_network_get_output_dims(
const ie_network_t* network,
const char* output_name,
dimensions_t* dims_result
);
void ie_network_input_shapes_free(input_shapes_t* inputShapes);
void ie_network_name_free(char** name);
Detailed Documentation¶
Set of functions managing network been read from the IR before loading of it to the device.
Global Functions¶
void ie_network_free(ie_network_t** network)
When network is loaded into the Infernece Engine, it is not required anymore and should be released.
Parameters:
network |
The pointer to the instance of the ie_network_t to free. |
IEStatusCode ie_network_get_name(const ie_network_t* network, char** name)
Get name of network.
Parameters:
network |
A pointer to the instance of the ie_network_t to get a name from. |
name |
Name of the network. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_inputs_number(
const ie_network_t* network,
size_t* size_result
)
Gets number of inputs for the network.
Parameters:
network |
A pointer to the instance of the ie_network_t to get number of input information. |
size_result |
A number of the instance’s input information. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_input_name(
const ie_network_t* network,
size_t number,
char** name
)
Gets name corresponding to the “number”. Use the ie_network_name_free() method to free memory.
Parameters:
network |
A pointer to theinstance of the ie_network_t to get input information. |
number |
An id of input information . |
name |
Input name corresponding to the number. |
Returns:
status Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_input_precision(
const ie_network_t* network,
const char* input_name,
precision_e* prec_result
)
Gets a precision of the input data provided by user.
Parameters:
network |
A pointer to ie_network_t instance. |
input_name |
Name of input data. |
prec_result |
A pointer to the precision used for input blob creation. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_set_input_precision(
ie_network_t* network,
const char* input_name,
const precision_e p
)
Changes the precision of the input data provided by the user. This function should be called before loading the network to the device.
Parameters:
network |
A pointer to ie_network_t instance. |
input_name |
Name of input data. |
p |
A new precision of the input data to set (eg. precision_e.FP16). |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_input_layout(
const ie_network_t* network,
const char* input_name,
layout_e* layout_result
)
Gets a layout of the input data.
Parameters:
network |
A pointer to ie_network_t instance. |
input_name |
Name of input data. |
layout_result |
A pointer to the layout used for input blob creation. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_set_input_layout(
ie_network_t* network,
const char* input_name,
const layout_e l
)
Changes the layout of the input data named “input_name”. This function should be called before loading the network to the device.
Parameters:
network |
A pointer to ie_network_t instance. |
input_name |
Name of input data. |
l |
A new layout of the input data to set. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_input_dims(
const ie_network_t* network,
const char* input_name,
dimensions_t* dims_result
)
Gets dimensions/shape of the input data with reversed order.
Parameters:
network |
A pointer to ie_network_t instance. |
input_name |
Name of input data. |
dims_result |
A pointer to the dimensions used for input blob creation. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_input_resize_algorithm(
const ie_network_t* network,
const char* input_name,
resize_alg_e* resize_alg_result
)
Gets pre-configured resize algorithm.
Parameters:
network |
A pointer to ie_network_t instance. |
input_name |
Name of input data. |
resize_alg_result |
The pointer to the resize algorithm used for input blob creation. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_set_input_resize_algorithm(
ie_network_t* network,
const char* input_name,
const resize_alg_e resize_algo
)
Sets resize algorithm to be used during pre-processing.
Parameters:
network |
A pointer to ie_network_t instance. |
input_name |
Name of input data. |
resize_algo |
Resize algorithm. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_color_format(
const ie_network_t* network,
const char* input_name,
colorformat_e* colformat_result
)
Gets color format of the input data.
Parameters:
network |
A pointer to ie_network_t instance. |
input_name |
Name of input data. |
colformat_result |
The pointer to the color format used for input blob creation. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_set_color_format(
ie_network_t* network,
const char* input_name,
const colorformat_e color_format
)
Changes the color format of the input data.
Parameters:
network |
A pointer to ie_network_t instance. |
input_name |
Name of input data. |
color_format |
Color format of the input data. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_input_shapes(
ie_network_t* network,
input_shapes_t* shapes
)
Helper method collect all input shapes with input names of corresponding input data. Use the ie_network_input_shapes_free() method to free memory.
Parameters:
network |
A pointer to the instance of the ie_network_t to get input shapes. |
shapes |
A pointer to the input_shapes. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_reshape(
ie_network_t* network,
const input_shapes_t shapes
)
Run shape inference with new input shapes for the network.
Parameters:
network |
A pointer to the instance of the ie_network_t to reshape. |
shapes |
A new input shapes to set for the network. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_outputs_number(
const ie_network_t* network,
size_t* size_result
)
Gets number of output for the network.
Parameters:
network |
A pointer to the instance of the ie_network_t to get number of output information. |
size_result |
A number of the network’s output information. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_output_name(
const ie_network_t* network,
const size_t number,
char** name
)
Gets name corresponding to the “number”. Use the ie_network_name_free() method to free memory.
Parameters:
network |
A pointer to theinstance of the ie_network_t to get output information. |
number |
An id of output information . |
name |
Output name corresponding to the number. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_output_precision(
const ie_network_t* network,
const char* output_name,
precision_e* prec_result
)
Gets a precision of the output data named “output_name”.
Parameters:
network |
A pointer to ie_network_t instance. |
output_name |
Name of output data. |
prec_result |
A pointer to the precision used for output blob creation. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_set_output_precision(
ie_network_t* network,
const char* output_name,
const precision_e p
)
Changes the precision of the output data named “output_name”.
Parameters:
network |
A pointer to ie_network_t instance. |
output_name |
Name of output data. |
p |
A new precision of the output data to set (eg. precision_e.FP16). |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_output_layout(
const ie_network_t* network,
const char* output_name,
layout_e* layout_result
)
Gets a layout of the output data.
Parameters:
network |
A pointer to ie_network_t instance. |
output_name |
Name of output data. |
layout_result |
A pointer to the layout used for output blob creation. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_set_output_layout(
ie_network_t* network,
const char* output_name,
const layout_e l
)
Changes the layout of the output data named “output_name”.
Parameters:
network |
A pointer to ie_network_t instance. |
output_name |
Name of output data. |
l |
A new layout of the output data to set. |
Returns:
Status code of the operation: OK(0) for success.
IEStatusCode ie_network_get_output_dims(
const ie_network_t* network,
const char* output_name,
dimensions_t* dims_result
)
Gets dimensions/shape of the output data with reversed order.
Parameters:
network |
A pointer to ie_network_t instance. |
output_name |
Name of output data. |
dims_result |
A pointer to the dimensions used for output blob creation. |
Returns:
Status code of the operation: OK(0) for success.
void ie_network_input_shapes_free(input_shapes_t* inputShapes)
Releases memory occupied by input_shapes.
Parameters:
inputShapes |
A pointer to the input_shapes to free memory. |
void ie_network_name_free(char** name)
Releases momory occupied by input_name or output_name.
Parameters:
name |
A pointer to the input_name or output_name to free memory. |