ie_transformations.hpp
Go to the documentation of this file.
1 // Copyright (C) 2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @brief This header file defines the list of public transformations.
7  *
8  * @file ie_transformations.hpp
9  */
10 
11 #pragma once
12 
13 #include <ie_api.h>
14 #include <cpp/ie_cnn_network.h>
15 
16 namespace InferenceEngine {
17 
18 /**
19  * @brief The transformation finds all TensorIterator layers in the network, processes all back
20  * edges that describe a connection between Result and Parameter of the TensorIterator body,
21  * and inserts ReadValue layer between Parameter and the next layers after this Parameter,
22  * and Assign layer after the layers before the Result layer.
23  * Supported platforms: CPU, GNA.
24  *
25  * The example below describes the changes to the inner part (body, back edges) of the TensorIterator layer.
26  * [] - TensorIterator body
27  * () - new layer
28  *
29  * before applying the transformation:
30  * back_edge_1 -> [Parameter -> some layers ... -> Result ] -> back_edge_1
31  *
32  * after applying the transformation:
33  * back_edge_1 -> [Parameter -> (ReadValue layer) -> some layers ... -> (Assign layer) ]
34  * \
35  * -> Result ] -> back_edge_1
36  *
37  * It is recommended to use this transformation in conjunction with the Reshape feature to set sequence
38  * dimension to 1 and with the UnrollTensorIterator transformation.
39  * For convenience, we have already enabled the unconditional execution of the UnrollTensorIterator
40  * transformation when using the LowLatency transformation for CPU, GNA plugins, no action is required here.
41  * After applying both of these transformations, the resulting network can be inferred step by
42  * step, the states will store between inferences.
43  *
44  * An illustrative example, not real API:
45  *
46  * network->reshape(...) // Set sequence dimension to 1, recalculating shapes. Optional, depends on the network.
47  * LowLatency(network) // Applying LowLatency and UnrollTensorIterator transformations.
48  * network->infer (...) // Calculating new values for states.
49  * // All states are stored between inferences via Assign, ReadValue layers.
50  * network->infer (...) // Using stored states, calculating new values for states.
51  *
52  * @param network A network to apply LowLatency transformation
53  * *
54  */
55 INFERENCE_ENGINE_API_CPP(void) LowLatency(InferenceEngine::CNNNetwork& network);
56 } // namespace InferenceEngine
This class contains all the information about the Neural Network and the related binary information.
Definition: ie_cnn_network.h:36
The macro defines a symbol import/export mechanism essential for Microsoft Windows(R) OS.
A header file that provides wrapper for ICNNNetwork object.
void LowLatency(InferenceEngine::CNNNetwork &network)
The transformation finds all TensorIterator layers in the network, processes all back edges that desc...