namespace InferenceEngine

Overview

Inference Engine C++ API. More…

namespace InferenceEngine {

// namespaces

namespace InferenceEngine::CLDNNConfigParams;
namespace InferenceEngine::GNAConfigParams;
namespace InferenceEngine::GPUConfigParams;
namespace InferenceEngine::GPUContextParams;
namespace InferenceEngine::HeteroConfigParams;
namespace InferenceEngine::Metrics;
namespace InferenceEngine::MultiDeviceConfigParams;
namespace InferenceEngine::PluginConfigInternalParams;
namespace InferenceEngine::PluginConfigParams;
namespace InferenceEngine::PrecisionUtils;
    namespace InferenceEngine::PrecisionUtils::details;
namespace InferenceEngine::VPUConfigParams;
namespace InferenceEngine::gpu;
namespace InferenceEngine::itt;
    namespace InferenceEngine::itt::domains;

// typedefs

typedef VariableState MemoryState;
typedef void* gpu_handle_param;
typedef std::map<std::string, Blob::Ptr> BlobMap;
typedef std::vector<size_t> SizeVector;
typedef std::shared_ptr<Data> DataPtr;
typedef std::shared_ptr<const Data> CDataPtr;
typedef std::weak_ptr<Data> DataWeakPtr;
typedef std::map<std::string, CDataPtr> ConstOutputsDataMap;
typedef std::map<std::string, DataPtr> OutputsDataMap;
typedef std::shared_ptr<IExtension> IExtensionPtr;
typedef IVariableState IMemoryState;
typedef std::map<std::string, InputInfo::Ptr> InputsDataMap;
typedef std::map<std::string, InputInfo::CPtr> ConstInputsDataMap;
typedef std::map<std::string, Parameter> ParamMap;
typedef details::SOPointer<IExecutableNetworkInternal> SoExecutableNetworkInternal;
typedef details::SOPointer<IInferRequestInternal> SoIInferRequestInternal;
typedef IVariableStateInternal IMemoryStateInternal;
typedef details::SOPointer<IVariableStateInternal> SoIVariableStateInternal;
typedef IVariableStateInternal MemoryStateInternal;
typedef short ie_fp16;
typedef std::function<void()> Task;
typedef tbb::enumerable_thread_specific<T> ThreadLocal;

// enums

enum ColorFormat;
enum Layout;
enum LockOp;
enum MeanVariant;
enum ResizeAlgorithm;
enum StatusCode;

// structs

struct DataConfig;
struct DescriptionBuffer;
struct Exception;
struct InferenceEngineProfileInfo;
struct LayerConfig;
struct PreProcessChannel;
template <Precision::ePrecision p>
struct PrecisionTrait;
struct QueryNetworkResult;
struct ROI;
struct ResponseDesc;
struct Version;

// unions

union UserValue;

// templates

template IAllocator;
template ICNNNetwork;
template ICore;
template IExecutableNetworkInternal;
template IInferRequestInternal;
template IInferencePlugin;
template ILayerExecImpl;
template ILayerImpl;
template IStreamsExecutor;
template ITaskExecutor;
template IVariableState;
template IVariableStateInternal;

// classes

class AsyncInferRequestThreadSafeDefault;
class BatchedBlob;
class Blob;
class BlockingDesc;
class CNNNetwork;
class CPUStreamsExecutor;
class CompoundBlob;
class Core;
class Data;
class DeviceIDParser;
class ExecutableNetwork;
class ExecutableNetworkThreadSafeDefault;
class ExecutorManager;
class Extension;
class I420Blob;
class IExecutableNetwork;
class IExtension;
class IInferRequest;
class ImmediateExecutor;
class InferRequest;
class InputInfo;
template <class T>
class LockedMemory;
template <>
class LockedMemory<void>;
template <class T>
class LockedMemory<const T>;
class MemoryBlob;
class NV12Blob;
class Parameter;
class PreProcessInfo;
class Precision;
class RemoteBlob;
class RemoteContext;
template <typename T, typename = std::enable_if<std::is_pod<T>::value>>
class TBlob;
class TensorDesc;
class VariableState;

// global variables

static constexpr auto KEY_AUTO_DEVICE_LIST = "AUTO_DEVICE_LIST";
static constexpr auto HDDL_GRAPH_TAG = "HDDL_GRAPH_TAG";
static constexpr auto HDDL_STREAM_ID = "HDDL_STREAM_ID";
static constexpr auto HDDL_DEVICE_TAG = "HDDL_DEVICE_TAG";
static constexpr auto HDDL_BIND_DEVICE = "HDDL_BIND_DEVICE";
static constexpr auto HDDL_RUNTIME_PRIORITY = "HDDL_RUNTIME_PRIORITY";
static constexpr auto HDDL_USE_SGAD = "HDDL_USE_SGAD";
static constexpr auto HDDL_GROUP_DEVICE = "HDDL_GROUP_DEVICE";
static constexpr auto MYRIAD_ENABLE_FORCE_RESET = "MYRIAD_ENABLE_FORCE_RESET";
static constexpr auto MYRIAD_DDR_TYPE = "MYRIAD_DDR_TYPE";
static constexpr auto MYRIAD_DDR_AUTO = "MYRIAD_DDR_AUTO";
static constexpr auto MYRIAD_DDR_MICRON_2GB = "MYRIAD_DDR_MICRON_2GB";
static constexpr auto MYRIAD_DDR_SAMSUNG_2GB = "MYRIAD_DDR_SAMSUNG_2GB";
static constexpr auto MYRIAD_DDR_HYNIX_2GB = "MYRIAD_DDR_HYNIX_2GB";
static constexpr auto MYRIAD_DDR_MICRON_1GB = "MYRIAD_DDR_MICRON_1GB";
static constexpr auto MYRIAD_PROTOCOL = "MYRIAD_PROTOCOL";
static constexpr auto MYRIAD_PCIE = "MYRIAD_PCIE";
static constexpr auto MYRIAD_USB = "MYRIAD_USB";
static constexpr auto MYRIAD_THROUGHPUT_STREAMS = "MYRIAD_THROUGHPUT_STREAMS";
static constexpr auto MYRIAD_ENABLE_HW_ACCELERATION = "MYRIAD_ENABLE_HW_ACCELERATION";
static constexpr auto MYRIAD_ENABLE_RECEIVING_TENSOR_TIME = "MYRIAD_ENABLE_RECEIVING_TENSOR_TIME";
static constexpr auto MYRIAD_CUSTOM_LAYERS = "MYRIAD_CUSTOM_LAYERS";

// global functions

std::shared_ptr<InferenceEngine::IAllocator> CreateDefaultAllocator();

template <
    typename T,
    typename std::enable_if<!std::is_pointer<T>::value&&!std::is_reference<T>::value, int>::type = 0,
    typename std::enable_if<std::is_base_of<Blob, T>::value, int>::type = 0
    >
std::shared_ptr<T> as(const Blob::Ptr& blob);

template <
    typename T,
    typename std::enable_if<!std::is_pointer<T>::value&&!std::is_reference<T>::value, int>::type = 0,
    typename std::enable_if<std::is_base_of<Blob, T>::value, int>::type = 0
    >
std::shared_ptr<const T> as(const Blob::CPtr& blob);

template <typename Type>
InferenceEngine::TBlob<Type>::Ptr make_shared_blob(const TensorDesc& tensorDesc);

template <typename Type>
InferenceEngine::TBlob<Type>::Ptr make_shared_blob(
    const TensorDesc& tensorDesc,
    Type* ptr,
    size_t size = 0
    );

template <typename Type>
InferenceEngine::TBlob<Type>::Ptr make_shared_blob(
    const TensorDesc& tensorDesc,
    const std::shared_ptr<InferenceEngine::IAllocator>& alloc
    );

template <typename TypeTo>
InferenceEngine::TBlob<TypeTo>::Ptr make_shared_blob(const TBlob<TypeTo>& arg);

template <
    typename T,
    typename... Args,
    typename std::enable_if<std::is_base_of<Blob, T>::value, int>::type = 0
    >
std::shared_ptr<T> make_shared_blob(Args&&... args);

Blob::Ptr make_shared_blob(const Blob::Ptr& inputBlob, const ROI& roi);
std::ostream& operator << (std::ostream& out, const Layout& p);
std::ostream& operator << (std::ostream& out, const ColorFormat& fmt);

template <typename T = IExtension>
std::shared_ptr<T> make_so_pointer(const std::string& name);

void CreateExtensionShared(IExtensionPtr& ext);
StatusCode CreateExtension(IExtension*& ext, ResponseDesc* resp);

TensorDesc make_roi_desc(
    const TensorDesc& origDesc,
    const ROI& roi,
    bool useOrigMemDesc
    );

RemoteBlob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx);
void LowLatency(InferenceEngine::CNNNetwork& network);

void lowLatency2(
    InferenceEngine::CNNNetwork& network,
    bool use_const_initializer = true
    );

std::string fileNameToString(const file_name_t& str);
file_name_t stringToFileName(const std::string& str);
const Version* GetInferenceEngineVersion();
void blob_copy(Blob::Ptr src, Blob::Ptr dst);
PreProcessInfo copyPreProcess(const PreProcessInfo& from);

template <typename T>
std::map<std::string, std::shared_ptr<const T>> constMapCast(const std::map<std::string, std::shared_ptr<T>>& map);

template <typename T>
std::map<std::string, std::shared_ptr<T>> constMapCast(const std::map<std::string, std::shared_ptr<const T>>& map);

InputsDataMap copyInfo(const InputsDataMap& networkInputs);
OutputsDataMap copyInfo(const OutputsDataMap& networkOutputs);
std::string getIELibraryPath();
inline ::FileUtils::FilePath getInferenceEngineLibraryPath();
bool checkOpenMpEnvVars(bool includeOMPNumThreads = true);
std::vector<int> getAvailableNUMANodes();
std::vector<int> getAvailableCoresTypes();
int getNumberOfCPUCores(bool bigCoresOnly = false);
bool with_cpu_x86_sse42();
bool with_cpu_x86_avx();
bool with_cpu_x86_avx2();
bool with_cpu_x86_avx512f();
bool with_cpu_x86_avx512_core();
bool with_cpu_x86_bfloat16();

} // namespace InferenceEngine

Detailed Documentation

Inference Engine C++ API.

Inference Engine Plugin API namespace.

Typedefs

typedef VariableState MemoryState

For compatibility reasons.

typedef void* gpu_handle_param

Shortcut for defining a handle parameter.

typedef std::map<std::string, Blob::Ptr> BlobMap

This is a convenient type for working with a map containing pairs(string, pointer to a Blob instance).

typedef std::vector<size_t> SizeVector

Represents tensor size.

The order is opposite to the order in Caffe*: (w,h,n,b) where the most frequently changing element in memory is first.

typedef std::shared_ptr<Data> DataPtr

Smart pointer to Data.

typedef std::shared_ptr<const Data> CDataPtr

Smart pointer to constant Data.

typedef std::weak_ptr<Data> DataWeakPtr

Smart weak pointer to Data.

typedef std::map<std::string, CDataPtr> ConstOutputsDataMap

A collection that contains string as key, and const Data smart pointer as value.

typedef std::map<std::string, DataPtr> OutputsDataMap

A collection that contains string as key, and Data smart pointer as value.

typedef std::shared_ptr<IExtension> IExtensionPtr

A shared pointer to a IExtension interface.

typedef IVariableState IMemoryState

For compatibility reasons.

typedef std::map<std::string, InputInfo::Ptr> InputsDataMap

A collection that contains string as key, and InputInfo smart pointer as value.

typedef std::map<std::string, InputInfo::CPtr> ConstInputsDataMap

A collection that contains string as key, and const InputInfo smart pointer as value.

typedef std::map<std::string, Parameter> ParamMap

An std::map object containing parameters.

typedef details::SOPointer<IExecutableNetworkInternal> SoExecutableNetworkInternal

SOPointer to IExecutableNetworkInternal.

typedef details::SOPointer<IInferRequestInternal> SoIInferRequestInternal

SOPointer to IInferRequestInternal.

typedef IVariableStateInternal IMemoryStateInternal

For compatibility reasons.

typedef details::SOPointer<IVariableStateInternal> SoIVariableStateInternal

SOPointer to IVariableStateInternal.

typedef IVariableStateInternal MemoryStateInternal

For compatibility reasons.

Global Variables

static constexpr auto KEY_AUTO_DEVICE_LIST = "AUTO_DEVICE_LIST"

Limit device list config option, with comma-separated devices listed.

static constexpr auto HDDL_GRAPH_TAG = "HDDL_GRAPH_TAG"

[Only for HDDLPlugin] Type: Arbitrary non-empty string. If empty (“”), equals no set, default: “”; This option allows to specify the number of MYX devices used for inference a specific Executable network. Note: Only one network would be allocated to one device. The number of devices for the tag is specified in the hddl_service.config file. Example: “service_settings”: { “graph_tag_map”: { “tagA”:3 } } It means that an executable network marked with tagA will be executed on 3 devices

static constexpr auto HDDL_STREAM_ID = "HDDL_STREAM_ID"

[Only for HDDLPlugin] Type: Arbitrary non-empty string. If empty (“”), equals no set, default: “”; This config makes the executable networks to be allocated on one certain device (instead of multiple devices). And all inference through this executable network, will be done on this device. Note: Only one network would be allocated to one device. The number of devices which will be used for stream-affinity must be specified in hddl_service.config file. Example: “service_settings”: { “stream_device_number”:5 } It means that 5 device will be used for stream-affinity

static constexpr auto HDDL_DEVICE_TAG = "HDDL_DEVICE_TAG"

[Only for HDDLPlugin] Type: Arbitrary non-empty string. If empty (“”), equals no set, default: “”; This config allows user to control device flexibly. This config gives a “tag” for a certain device while allocating a network to it. Afterward, user can allocating/deallocating networks to this device with this “tag”. Devices used for such use case is controlled by a so-called “Bypass Scheduler” in HDDL backend, and the number of such device need to be specified in hddl_service.config file. Example: “service_settings”: { “bypass_device_number”: 5 } It means that 5 device will be used for Bypass scheduler.

static constexpr auto HDDL_BIND_DEVICE = "HDDL_BIND_DEVICE"

[Only for HDDLPlugin] Type: “YES/NO”, default is “NO”. This config is a sub-config of DEVICE_TAG, and only available when “DEVICE_TAG” is set. After a user load a network, the user got a handle for the network. If “YES”, the network allocated is bind to the device (with the specified “DEVICE_TAG”), which means all afterwards inference through this network handle will be executed on this device only. If “NO”, the network allocated is not bind to the device (with the specified “DEVICE_TAG”). If the same network is allocated on multiple other devices (also set BIND_DEVICE to “False”), then inference through any handle of these networks may be executed on any of these devices those have the network loaded.

static constexpr auto HDDL_RUNTIME_PRIORITY = "HDDL_RUNTIME_PRIORITY"

[Only for HDDLPlugin] Type: A signed int wrapped in a string, default is “0”. This config is a sub-config of DEVICE_TAG, and only available when “DEVICE_TAG” is set and “BIND_DEVICE” is “False”. When there are multiple devices running a certain network (a same network running on multiple devices in Bypass Scheduler), the device with a larger number has a higher priority, and more inference tasks will be fed to it with priority.

static constexpr auto HDDL_USE_SGAD = "HDDL_USE_SGAD"

[Only for HDDLPlugin] Type: “YES/NO”, default is “NO”. SGAD is short for “Single Graph All Device”. With this scheduler, once application allocates 1 network, all devices (managed by SGAD scheduler) will be loaded with this graph. The number of network that can be loaded to one device can exceed one. Once application deallocates 1 network from device, all devices will unload the network from them.

static constexpr auto HDDL_GROUP_DEVICE = "HDDL_GROUP_DEVICE"

[Only for HDDLPlugin] Type: A signed int wrapped in a string, default is “0”. This config gives a “group id” for a certain device when this device has been reserved for certain client, client can use this device grouped by calling this group id while other client can’t use this device Each device has their own group id. Device in one group shares same group id.

static constexpr auto MYRIAD_ENABLE_FORCE_RESET = "MYRIAD_ENABLE_FORCE_RESET"

The flag to reset stalled devices. This is a plugin scope option and must be used with the plugin’s SetConfig method The only possible values are: CONFIG_VALUE(YES) CONFIG_VALUE(NO) (default value)

static constexpr auto MYRIAD_DDR_TYPE = "MYRIAD_DDR_TYPE"

This option allows to specify device memory type.

static constexpr auto MYRIAD_DDR_AUTO = "MYRIAD_DDR_AUTO"

Supported keys definition for InferenceEngine::MYRIAD_DDR_TYPE option.

static constexpr auto MYRIAD_PROTOCOL = "MYRIAD_PROTOCOL"

This option allows to specify protocol.

static constexpr auto MYRIAD_PCIE = "MYRIAD_PCIE"

Supported keys definition for InferenceEngine::MYRIAD_PROTOCOL option.

static constexpr auto MYRIAD_THROUGHPUT_STREAMS = "MYRIAD_THROUGHPUT_STREAMS"

Optimize vpu plugin execution to maximize throughput. This option should be used with integer value which is the requested number of streams. The only possible values are: 1 2 3.

static constexpr auto MYRIAD_ENABLE_HW_ACCELERATION = "MYRIAD_ENABLE_HW_ACCELERATION"

Turn on HW stages usage (applicable for MyriadX devices only). The only possible values are: CONFIG_VALUE(YES) (default value) CONFIG_VALUE(NO)

static constexpr auto MYRIAD_ENABLE_RECEIVING_TENSOR_TIME = "MYRIAD_ENABLE_RECEIVING_TENSOR_TIME"

The flag for adding to the profiling information the time of obtaining a tensor. The only possible values are: CONFIG_VALUE(YES) CONFIG_VALUE(NO) (default value)

static constexpr auto MYRIAD_CUSTOM_LAYERS = "MYRIAD_CUSTOM_LAYERS"

This option allows to pass custom layers binding xml. If layer is present in such an xml, it would be used during inference even if the layer is natively supported.

Global Functions

std::shared_ptr<InferenceEngine::IAllocator> CreateDefaultAllocator()

Creates the default implementation of the Inference Engine allocator per plugin.

Returns:

The Inference Engine IAllocator* instance

template <
    typename T,
    typename std::enable_if<!std::is_pointer<T>::value&&!std::is_reference<T>::value, int>::type = 0,
    typename std::enable_if<std::is_base_of<Blob, T>::value, int>::type = 0
    >
std::shared_ptr<T> as(const Blob::Ptr& blob)

Helper cast function to work with shared Blob objects.

Parameters:

blob

A blob to cast

Returns:

shared_ptr to the type T. Returned shared_ptr shares ownership of the object with the input Blob::Ptr

template <
    typename T,
    typename std::enable_if<!std::is_pointer<T>::value&&!std::is_reference<T>::value, int>::type = 0,
    typename std::enable_if<std::is_base_of<Blob, T>::value, int>::type = 0
    >
std::shared_ptr<const T> as(const Blob::CPtr& blob)

Helper cast function to work with shared Blob objects.

Parameters:

blob

A blob to cast

Returns:

shared_ptr to the type const T. Returned shared_ptr shares ownership of the object with the input Blob::Ptr

template <typename Type>
InferenceEngine::TBlob<Type>::Ptr make_shared_blob(const TensorDesc& tensorDesc)

Creates a blob with the given tensor descriptor.

Parameters:

Type

Type of the shared pointer to be created

tensorDesc

Tensor descriptor for Blob creation

Returns:

A shared pointer to the newly created blob of the given type

template <typename Type>
InferenceEngine::TBlob<Type>::Ptr make_shared_blob(
    const TensorDesc& tensorDesc,
    Type* ptr,
    size_t size = 0
    )

Creates a blob with the given tensor descriptor from the pointer to the pre-allocated memory.

Parameters:

Type

Type of the shared pointer to be created

tensorDesc

TensorDesc for Blob creation

ptr

Pointer to the pre-allocated memory

size

Length of the pre-allocated array

Returns:

A shared pointer to the newly created blob of the given type

template <typename Type>
InferenceEngine::TBlob<Type>::Ptr make_shared_blob(
    const TensorDesc& tensorDesc,
    const std::shared_ptr<InferenceEngine::IAllocator>& alloc
    )

Creates a blob with the given tensor descriptor and allocator.

Parameters:

Type

Type of the shared pointer to be created

tensorDesc

Tensor descriptor for Blob creation

alloc

Shared pointer to IAllocator to use in the blob

Returns:

A shared pointer to the newly created blob of the given type

template <typename TypeTo>
InferenceEngine::TBlob<TypeTo>::Ptr make_shared_blob(const TBlob<TypeTo>& arg)

Creates a copy of given TBlob instance.

Parameters:

TypeTo

Type of the shared pointer to be created

arg

given pointer to blob

Returns:

A shared pointer to the newly created blob of the given type

template <
    typename T,
    typename... Args,
    typename std::enable_if<std::is_base_of<Blob, T>::value, int>::type = 0
    >
std::shared_ptr<T> make_shared_blob(Args&&... args)

Creates a Blob object of the specified type.

Parameters:

args

Constructor arguments for the Blob object

Returns:

A shared pointer to the newly created Blob object

Blob::Ptr make_shared_blob(const Blob::Ptr& inputBlob, const ROI& roi)

Creates a blob describing given ROI object based on the given blob with pre-allocated memory.

Parameters:

inputBlob

original blob with pre-allocated memory.

roi

A ROI object inside of the original blob.

Returns:

A shared pointer to the newly created blob.

std::ostream& operator << (std::ostream& out, const Layout& p)

Prints a string representation of InferenceEngine::Layout to a stream.

Parameters:

out

An output stream to send to

p

A layout value to print to a stream

Returns:

A reference to the out stream

std::ostream& operator << (std::ostream& out, const ColorFormat& fmt)

Prints a string representation of InferenceEngine::ColorFormat to a stream.

Parameters:

out

An output stream to send to

fmt

A color format value to print to a stream

Returns:

A reference to the out stream

template <typename T = IExtension>
std::shared_ptr<T> make_so_pointer(const std::string& name)

Creates extension using deprecated API.

Parameters:

T

extension type

name

extension library name

Returns:

shared pointer to extension

void CreateExtensionShared(IExtensionPtr& ext)

Creates the default instance of the extension.

Parameters:

ext

Extension interface

StatusCode CreateExtension(IExtension*& ext, ResponseDesc* resp)

Creates the default instance of the extension.

: Deprecated API

Parameters:

ext

Extension interface

resp

Responce

Returns:

InferenceEngine::OK if extension is constructed and InferenceEngine::GENERAL_ERROR otherwise

TensorDesc make_roi_desc(
    const TensorDesc& origDesc,
    const ROI& roi,
    bool useOrigMemDesc
    )

Creates a TensorDesc object for ROI.

Parameters:

origDesc

original TensorDesc object.

roi

An image ROI object inside of the original object.

useOrigMemDesc

Flag to use original memory description (strides/offset). Should be set if the new TensorDesc describes shared memory.

Returns:

A newly created TensorDesc object representing ROI.

RemoteBlob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx)

A wrapper of CreateBlob method of RemoteContext to keep consistency with plugin-specific wrappers.

Parameters:

desc

Defines the layout and dims of the blob

ctx

Pointer to the plugin object derived from RemoteContext.

Returns:

A pointer to plugin object that implements RemoteBlob interface.

void LowLatency(InferenceEngine::CNNNetwork& network)

The transformation finds all TensorIterator layers in the network, processes all back edges that describe a connection between Result and Parameter of the TensorIterator body, and inserts ReadValue layer between Parameter and the next layers after this Parameter, and Assign layer after the layers before the Result layer. Supported platforms: CPU, GNA.

Deprecated This transformation will be removed in 2023.1.

The example below describes the changes to the inner part (body, back edges) of the TensorIterator layer. [] - TensorIterator body () - new layer

before applying the transformation: back_edge_1 -> [Parameter -> some layers … -> Result ] -> back_edge_1

after applying the transformation: back_edge_1 -> [Parameter -> (ReadValue layer) -> some layers … -> (Assign layer) ] -> Result ] -> back_edge_1

It is recommended to use this transformation in conjunction with the Reshape feature to set sequence dimension to 1 and with the UnrollTensorIterator transformation. For convenience, we have already enabled the unconditional execution of the UnrollTensorIterator transformation when using the LowLatency transformation for CPU, GNA plugins, no action is required here. After applying both of these transformations, the resulting network can be inferred step by step, the states will store between inferences.

An illustrative example, not real API:

network->reshape(…) // Set sequence dimension to 1, recalculating shapes. Optional, depends on the network. LowLatency(network) // Applying LowLatency and UnrollTensorIterator transformations. network->infer (…) // Calculating new values for states. // All states are stored between inferences via Assign, ReadValue layers. network->infer (…) // Using stored states, calculating new values for states.

Parameters:

network

A network to apply LowLatency transformation

void lowLatency2(
    InferenceEngine::CNNNetwork& network,
    bool use_const_initializer = true
    )

The transformation finds all TensorIterator/Loop layers in the network, processes all back edges that describe a connection between Result and Parameter of the TensorIterator/Loop bodies,and inserts ReadValue and Assign layers at the input and output corresponding to this back edge. Supported platforms: CPU, GNA.

The example below describes the changes made by the transformation [] - TensorIterator body () - new layer BE - back-edge

before applying the transformation: -> input1[BE_1 -> Parameter -> Layers … -> Result -> BE_1 ]output1->

after applying the transformation: ->(ReadValue)-> input1[BE_1 ->Parameter->Layers …->Result->BE_1]output1 ->(Assign) ->… After applying the transformation, the resulting network can be inferred step by step, the states will store between inferences.

Parameters:

network

A network to apply LowLatency transformation

use_const_initializer

Changes the type of the initializing subgraph for ReadValue operations. If “true”, then the transformation inserts Constant before ReadValue operation. If “false, then the transformation leaves existed initializing subgraph for ReadValue operation. Loop operation by a given number. Does not affect TensorIterators.

std::string fileNameToString(const file_name_t& str)

Conversion from possibly-wide character string to a single-byte chain.

Deprecated Use OS-native conversion utilities

Parameters:

str

A possibly-wide character string

Returns:

A single-byte character string

file_name_t stringToFileName(const std::string& str)

Conversion from single-byte character string to a possibly-wide one.

Deprecated Use OS-native conversion utilities

Parameters:

str

A single-byte character string

Returns:

A possibly-wide character string

const Version* GetInferenceEngineVersion()

Gets the current Inference Engine version.

Returns:

The current Inference Engine version

PreProcessInfo copyPreProcess(const PreProcessInfo& from)

Copies preprocess info.

Parameters:

from

PreProcessInfo to copy from

Returns:

copy of preprocess info

template <typename T>
std::map<std::string, std::shared_ptr<const T>> constMapCast(const std::map<std::string, std::shared_ptr<T>>& map)

Copies the values of std::string indexed map and apply const cast.

Parameters:

map

map to copy

Returns:

map that contains pointers to constant values

template <typename T>
std::map<std::string, std::shared_ptr<T>> constMapCast(const std::map<std::string, std::shared_ptr<const T>>& map)

Copies the values of std::string indexed map and apply const cast.

Parameters:

map

map to copy

Returns:

map that contains pointers to values

InputsDataMap copyInfo(const InputsDataMap& networkInputs)

Copies InputInfo.

Parameters:

networkInputs

The network inputs to copy from

Returns:

copy of network inputs

OutputsDataMap copyInfo(const OutputsDataMap& networkOutputs)

Copies OutputsData.

Parameters:

networkInputs

network outputs to copy from

Returns:

copy of network outputs