low_latency.hpp
1 // Copyright (C) 2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include <memory>
8 #include <vector>
9 
10 #include <ngraph/pass/graph_rewrite.hpp>
11 
12 namespace ngraph
13 {
14  namespace pass
15  {
16  /**
17  * @brief The transformation finds all TensorIterator layers in the network,
18  * processes all back edges that describe a connection between Result and Parameter
19  * of the TensorIterator body,and inserts ReadValue layer between Parameter
20  * and the next layers after this Parameter, and Assign layer after the layers
21  * before the Result layer. Supported platforms: CPU, GNA.
22  *
23  * The example below describes the changes to the inner part (body, back edges) of the
24  * Tensor Iterator layer.
25  * [] - TensorIterator body
26  * () - new layer
27  *
28  * before applying the transformation:
29  * back_edge_1 -> [Parameter -> some layers ... -> Result ] -> back_edge_1
30  *
31  * after applying the transformation:
32  * back_edge_1 -> [Parameter -> (ReadValue layer) -> some layers ... -> (Assign layer) ]
33  * \
34  * -> Result ] -> back_edge_1
35  *
36  * It is recommended to use this transformation in conjunction with the Reshape feature to
37  * set sequence dimension to 1 and with the UnrollTensorIterator transformation.
38  * For convenience, we have already enabled the unconditional execution of the
39  * UnrollTensorIterator transformation when using the LowLatency transformation for
40  * CPU, GNA plugins, no action is required here.
41  * After applying both of these transformations, the resulting network can be inferred step
42  * by step, the states will store between inferences.
43  */
44 
45  class NGRAPH_API LowLatency : public ngraph::pass::MatcherPass
46  {
47  public:
48  NGRAPH_RTTI_DECLARATION;
49  LowLatency();
50  };
51  } // namespace pass
52 } // namespace ngraph
The transformation finds all TensorIterator layers in the network, processes all back edges that desc...
Definition: low_latency.hpp:46
MatcherPass is a basic block for pattern based transformations. It describes pattern and action that ...
Definition: graph_rewrite.hpp:60
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28