An optimal implementation of IInferRequestInternal interface to avoid duplication in all plugins This base class is recommended to be used as a base class for plugin synchronous inference request implementation. More...
#include <ie_infer_request_internal.hpp>
Public Types | |
typedef std::shared_ptr< InferRequestInternal > | Ptr |
A shared pointer to a InferRequestInternal implementation. | |
Public Types inherited from InferenceEngine::IInferRequestInternal | |
typedef std::shared_ptr< IInferRequestInternal > | Ptr |
A shared pointer to a IInferRequestInternal interface. | |
Public Member Functions | |
InferRequestInternal (const InputsDataMap &networkInputs, const OutputsDataMap &networkOutputs) | |
Constructs a new instance. More... | |
virtual void | InferImpl ()=0 |
The minimal infer function to be implemented by plugins. It infers specified input(s) in synchronous mode. More... | |
void | Infer () override |
Default common implementation for all plugins with checking input and output blobs before inference. | |
void | SetBlob (const char *name, const Blob::Ptr &data) override |
Given optional implementation of setting blob to avoid need for it to be implemented by plugin. More... | |
void | GetBlob (const char *name, Blob::Ptr &data) override |
Given optional implementation of getting blob to avoid need for it to be implemented by plugin. More... | |
void | SetBlob (const char *name, const Blob::Ptr &data, const PreProcessInfo &info) override |
Sets pre-process for input data. More... | |
void | GetPreProcess (const char *name, const PreProcessInfo **info) const override |
Gets pre-process for input data. More... | |
void | setPointerToExecutableNetworkInternal (std::shared_ptr< ExecutableNetworkInternal > exeNetwork) |
Sets the pointer to executable network internal. More... | |
virtual void | checkBlobs () |
Checks that both inputs and outputs blob are valid. Throws an exception if they are not. | |
void | SetBatch (int batch) override |
Sets new batch size when dynamic batching is enabled in executable network that created this request. More... | |
void | execDataPreprocessing (InferenceEngine::BlobMap &inputs, bool serial=false) |
Checks and executes input data pre-processing if needed. More... | |
Public Member Functions inherited from InferenceEngine::IInferRequestInternal | |
virtual | ~IInferRequestInternal ()=default |
Destroys the object. | |
virtual void | GetPerformanceCounts (std::map< std::string, InferenceEngineProfileInfo > &perfMap) const =0 |
Queries performance measures per layer to get feedback of what is the most time consuming layer. Note: not all plugins may provide meaningful data. More... | |
Protected Member Functions | |
bool | findInputAndOutputBlobByName (const char *name, InputInfo::Ptr &foundInput, DataPtr &foundOutput) const |
Helper function to find input or output blob by name. More... | |
void | checkBlob (const Blob::Ptr &blob, const std::string &name, bool isInput, const SizeVector &refDims={}) const |
Check that blob is valid. Throws an exception if it's not. More... | |
bool | preProcessingRequired (const InputInfo::Ptr &info, const Blob::Ptr &blob) |
Checks whether pre-processing step is required for a given input. More... | |
Protected Attributes | |
InferenceEngine::InputsDataMap | _networkInputs |
Holds information about network inputs info. | |
InferenceEngine::OutputsDataMap | _networkOutputs |
Holds information about network outputs data. | |
InferenceEngine::BlobMap | _inputs |
A map of network input blobs. | |
InferenceEngine::BlobMap | _outputs |
A map of network output blobs. | |
std::map< std::string, PreProcessDataPtr > | _preProcData |
A map of pre-process data per input. | |
int | m_curBatch |
Current batch value used in dynamic batching. | |
std::shared_ptr< ExecutableNetworkInternal > | _exeNetwork |
A shared pointer to ExecutableNetworkInternal interface. More... | |
An optimal implementation of IInferRequestInternal interface to avoid duplication in all plugins This base class is recommended to be used as a base class for plugin synchronous inference request implementation.
|
inline |
Constructs a new instance.
[in] | networkInputs | The network inputs info |
[in] | networkOutputs | The network outputs data |
|
inlineprotected |
Check that blob
is valid. Throws an exception if it's not.
[in] | blob | The blob to check |
[in] | name | The name of input or output depending of if the blob is input or output |
[in] | isInput | Indicates if is input |
[in] | refDims | The reference dims, empty if not specified |
|
inline |
Checks and executes input data pre-processing if needed.
inputs | Inputs blobs to perform preprocessing on |
serial | Whether to use multiple threads to execute the step |
|
inlineprotected |
Helper function to find input or output blob by name.
name | A name of input or output blob. |
foundInput | A pointer to input information if found. |
foundOutput | A pointer to output DataPtr if found. |
True
- if loaded network has input with provided name, false
- if loaded network has output with provided name [parameter_mismatch] | exception if input and output has the same name |
[not_found] | exception if there is no input and output layers with given name |
|
inlineoverridevirtual |
Given optional implementation of getting blob to avoid need for it to be implemented by plugin.
name | - a name of input or output blob. |
data | - a reference to input or output blob. The type of Blob must correspond to the network input precision and size. |
Implements InferenceEngine::IInferRequestInternal.
|
inlineoverridevirtual |
Gets pre-process for input data.
name | Name of input blob. |
info | pointer to a pointer to PreProcessInfo structure |
Implements InferenceEngine::IInferRequestInternal.
|
pure virtual |
The minimal infer function to be implemented by plugins. It infers specified input(s) in synchronous mode.
|
inlineprotected |
|
inlineoverridevirtual |
Sets new batch size when dynamic batching is enabled in executable network that created this request.
batch | - new batch size to be used by all the following inference calls for this request. |
Implements InferenceEngine::IInferRequestInternal.
|
inlineoverridevirtual |
Given optional implementation of setting blob to avoid need for it to be implemented by plugin.
name | - a name of input or output blob. |
data | - a reference to input or output blob. The type of Blob must correspond to the network input precision and size. |
Implements InferenceEngine::IInferRequestInternal.
|
inlineoverridevirtual |
Sets pre-process for input data.
name | Name of input blob. |
data | - a reference to input or output blob. The type of Blob must correspond to the network input precision and size. |
info | Preprocess info for blob. |
Implements InferenceEngine::IInferRequestInternal.
|
inline |
Sets the pointer to executable network internal.
[in] | exeNetwork | The executable network |
|
protected |
A shared pointer to ExecutableNetworkInternal interface.