This class provides an interface to infer requests of ExecutableNetwork
and serves to handle infer requests execution and to set and get output data.
More...
Public Member Functions | |
def | __init__ (self) |
There is no explicit class constructor. More... |
|
def | set_completion_callback (self, py_callback, py_data=None) |
Description: Sets a callback function that is called on success or failure of an asynchronous request. More... |
|
def | infer (self, inputs=None) |
Starts synchronous inference of the infer request and fill outputs array. More... |
|
def | async_infer (self, inputs=None) |
Starts asynchronous inference of the infer request and fill outputs array. More... |
|
def | wait (self, timeout=None) |
Waits for the result to become available. More... |
|
def | get_perf_counts (self) |
Queries performance measures per layer to get feedback of what is the most time consuming layer. More... |
|
def | set_batch (self, size) |
Sets new batch size for certain infer request when dynamic batching is enabled in executable network that created this request. More... |
|
This class provides an interface to infer requests of ExecutableNetwork
and serves to handle infer requests execution and to set and get output data.
def ie_api.InferRequest.__init__ | ( | self | ) |
There is no explicit class constructor.
To make a valid InferRequest
instance, use load_network()
method of the IECore
class with specified number of requests to get ExecutableNetwork
instance which stores infer requests.
def ie_api.InferRequest.async_infer | ( | self, | |
inputs = None |
|||
) |
Starts asynchronous inference of the infer request and fill outputs array.
inputs | A dictionary that maps input layer names to numpy.ndarray objects of proper shape with input data for the layer |
Usage example:
def ie_api.InferRequest.get_perf_counts | ( | self | ) |
Queries performance measures per layer to get feedback of what is the most time consuming layer.
NOTE: Performance counters data and format depends on the plugin
Usage example:
def ie_api.InferRequest.infer | ( | self, | |
inputs = None |
|||
) |
Starts synchronous inference of the infer request and fill outputs array.
inputs | A dictionary that maps input layer names to numpy.ndarray objects of proper shape with input data for the layer |
Usage example:
def ie_api.InferRequest.set_batch | ( | self, | |
size | |||
) |
Sets new batch size for certain infer request when dynamic batching is enabled in executable network that created this request.
NOTE: Support of dynamic batch size depends on the target plugin.
size | New batch size to be used by all the following inference calls for this request |
Usage example:
def ie_api.InferRequest.set_completion_callback | ( | self, | |
py_callback, | |||
py_data = None |
|||
) |
Description: Sets a callback function that is called on success or failure of an asynchronous request.
py_callback | - Any defined or lambda function |
py_data | - Data that is passed to the callback function |
Usage example:
def ie_api.InferRequest.wait | ( | self, | |
timeout = None |
|||
) |
Waits for the result to become available.
Blocks until specified timeout elapses or the result becomes available, whichever comes first. NOTE: There are special values of the timeout parameter:
timeout | Time to wait in milliseconds or special (0, -1) cases described above. If not specified, timeout value is set to -1 by default. |
Usage example: See async_infer()
method of the the InferRequest
class.