1 | // This file is MACHINE GENERATED! Do not edit. |
2 | |
3 | #ifndef TENSORFLOW_CC_OPS_CONTROL_FLOW_OPS_INTERNAL_H_ |
4 | #define TENSORFLOW_CC_OPS_CONTROL_FLOW_OPS_INTERNAL_H_ |
5 | |
6 | // This file is MACHINE GENERATED! Do not edit. |
7 | |
8 | #include "tensorflow/cc/framework/ops.h" |
9 | #include "tensorflow/cc/framework/scope.h" |
10 | #include "tensorflow/core/framework/tensor.h" |
11 | #include "tensorflow/core/framework/tensor_shape.h" |
12 | #include "tensorflow/core/framework/types.h" |
13 | #include "tensorflow/core/lib/gtl/array_slice.h" |
14 | |
15 | namespace tensorflow { |
16 | namespace ops { |
17 | namespace internal { |
18 | // NOTE: This namespace has internal TensorFlow details that |
19 | // are not part of TensorFlow's public API. |
20 | |
21 | /// @defgroup control_flow_ops_internal Control Flow Ops Internal |
22 | /// @{ |
23 | |
24 | /// Creates or finds a child frame, and makes `data` available to the child frame. |
25 | /// |
26 | /// This op is used together with `Exit` to create loops in the graph. |
27 | /// The unique `frame_name` is used by the `Executor` to identify frames. If |
28 | /// `is_constant` is true, `output` is a constant in the child frame; otherwise |
29 | /// it may be changed in the child frame. At most `parallel_iterations` iterations |
30 | /// are run in parallel in the child frame. |
31 | /// |
32 | /// Args: |
33 | /// * scope: A Scope object |
34 | /// * data: The tensor to be made available to the child frame. |
35 | /// * frame_name: The name of the child frame. |
36 | /// |
37 | /// Optional attributes (see `Attrs`): |
38 | /// * is_constant: If true, the output is constant within the child frame. |
39 | /// * parallel_iterations: The number of iterations allowed to run in parallel. |
40 | /// |
41 | /// Returns: |
42 | /// * `Output`: The same tensor as `data`. |
43 | class Enter { |
44 | public: |
45 | /// Optional attribute setters for Enter |
46 | struct Attrs { |
47 | /// If true, the output is constant within the child frame. |
48 | /// |
49 | /// Defaults to false |
50 | TF_MUST_USE_RESULT Attrs IsConstant(bool x) { |
51 | Attrs ret = *this; |
52 | ret.is_constant_ = x; |
53 | return ret; |
54 | } |
55 | |
56 | /// The number of iterations allowed to run in parallel. |
57 | /// |
58 | /// Defaults to 10 |
59 | TF_MUST_USE_RESULT Attrs ParallelIterations(int64 x) { |
60 | Attrs ret = *this; |
61 | ret.parallel_iterations_ = x; |
62 | return ret; |
63 | } |
64 | |
65 | bool is_constant_ = false; |
66 | int64 parallel_iterations_ = 10; |
67 | }; |
68 | Enter(const ::tensorflow::Scope& scope, ::tensorflow::Input data, StringPiece |
69 | frame_name); |
70 | Enter(const ::tensorflow::Scope& scope, ::tensorflow::Input data, StringPiece |
71 | frame_name, const Enter::Attrs& attrs); |
72 | operator ::tensorflow::Output() const { return output; } |
73 | operator ::tensorflow::Input() const { return output; } |
74 | ::tensorflow::Node* node() const { return output.node(); } |
75 | |
76 | static Attrs IsConstant(bool x) { |
77 | return Attrs().IsConstant(x); |
78 | } |
79 | static Attrs ParallelIterations(int64 x) { |
80 | return Attrs().ParallelIterations(x); |
81 | } |
82 | |
83 | Operation operation; |
84 | ::tensorflow::Output output; |
85 | }; |
86 | |
87 | /// Exits the current frame to its parent frame. |
88 | /// |
89 | /// Exit makes its input `data` available to the parent frame. |
90 | /// |
91 | /// Args: |
92 | /// * scope: A Scope object |
93 | /// * data: The tensor to be made available to the parent frame. |
94 | /// |
95 | /// Returns: |
96 | /// * `Output`: The same tensor as `data`. |
97 | class Exit { |
98 | public: |
99 | Exit(const ::tensorflow::Scope& scope, ::tensorflow::Input data); |
100 | operator ::tensorflow::Output() const { return output; } |
101 | operator ::tensorflow::Input() const { return output; } |
102 | ::tensorflow::Node* node() const { return output.node(); } |
103 | |
104 | Operation operation; |
105 | ::tensorflow::Output output; |
106 | }; |
107 | |
108 | /// Creates or finds a child frame, and makes `data` available to the child frame. |
109 | /// |
110 | /// The unique `frame_name` is used by the `Executor` to identify frames. If |
111 | /// `is_constant` is true, `output` is a constant in the child frame; otherwise |
112 | /// it may be changed in the child frame. At most `parallel_iterations` iterations |
113 | /// are run in parallel in the child frame. |
114 | /// |
115 | /// Args: |
116 | /// * scope: A Scope object |
117 | /// * data: The tensor to be made available to the child frame. |
118 | /// * frame_name: The name of the child frame. |
119 | /// |
120 | /// Optional attributes (see `Attrs`): |
121 | /// * is_constant: If true, the output is constant within the child frame. |
122 | /// * parallel_iterations: The number of iterations allowed to run in parallel. |
123 | /// |
124 | /// Returns: |
125 | /// * `Output`: The same tensor as `data`. |
126 | class RefEnter { |
127 | public: |
128 | /// Optional attribute setters for RefEnter |
129 | struct Attrs { |
130 | /// If true, the output is constant within the child frame. |
131 | /// |
132 | /// Defaults to false |
133 | TF_MUST_USE_RESULT Attrs IsConstant(bool x) { |
134 | Attrs ret = *this; |
135 | ret.is_constant_ = x; |
136 | return ret; |
137 | } |
138 | |
139 | /// The number of iterations allowed to run in parallel. |
140 | /// |
141 | /// Defaults to 10 |
142 | TF_MUST_USE_RESULT Attrs ParallelIterations(int64 x) { |
143 | Attrs ret = *this; |
144 | ret.parallel_iterations_ = x; |
145 | return ret; |
146 | } |
147 | |
148 | bool is_constant_ = false; |
149 | int64 parallel_iterations_ = 10; |
150 | }; |
151 | RefEnter(const ::tensorflow::Scope& scope, ::tensorflow::Input data, |
152 | StringPiece frame_name); |
153 | RefEnter(const ::tensorflow::Scope& scope, ::tensorflow::Input data, |
154 | StringPiece frame_name, const RefEnter::Attrs& attrs); |
155 | operator ::tensorflow::Output() const { return output; } |
156 | operator ::tensorflow::Input() const { return output; } |
157 | ::tensorflow::Node* node() const { return output.node(); } |
158 | |
159 | static Attrs IsConstant(bool x) { |
160 | return Attrs().IsConstant(x); |
161 | } |
162 | static Attrs ParallelIterations(int64 x) { |
163 | return Attrs().ParallelIterations(x); |
164 | } |
165 | |
166 | Operation operation; |
167 | ::tensorflow::Output output; |
168 | }; |
169 | |
170 | /// Exits the current frame to its parent frame. |
171 | /// |
172 | /// Exit makes its input `data` available to the parent frame. |
173 | /// |
174 | /// Args: |
175 | /// * scope: A Scope object |
176 | /// * data: The tensor to be made available to the parent frame. |
177 | /// |
178 | /// Returns: |
179 | /// * `Output`: The same tensor as `data`. |
180 | class RefExit { |
181 | public: |
182 | RefExit(const ::tensorflow::Scope& scope, ::tensorflow::Input data); |
183 | operator ::tensorflow::Output() const { return output; } |
184 | operator ::tensorflow::Input() const { return output; } |
185 | ::tensorflow::Node* node() const { return output.node(); } |
186 | |
187 | Operation operation; |
188 | ::tensorflow::Output output; |
189 | }; |
190 | |
191 | /// Forwards the value of an available tensor from `inputs` to `output`. |
192 | /// |
193 | /// `Merge` waits for at least one of the tensors in `inputs` to become available. |
194 | /// It is usually combined with `Switch` to implement branching. |
195 | /// |
196 | /// `Merge` forwards the first tensor for become available to `output`, and sets |
197 | /// `value_index` to its index in `inputs`. |
198 | /// |
199 | /// Args: |
200 | /// * scope: A Scope object |
201 | /// * inputs: The input tensors, exactly one of which will become available. |
202 | /// |
203 | /// Returns: |
204 | /// * `Output` output: Will be set to the available input tensor. |
205 | /// * `Output` value_index: The index of the chosen input tensor in `inputs`. |
206 | class RefMerge { |
207 | public: |
208 | RefMerge(const ::tensorflow::Scope& scope, ::tensorflow::InputList inputs); |
209 | |
210 | Operation operation; |
211 | ::tensorflow::Output output; |
212 | ::tensorflow::Output value_index; |
213 | }; |
214 | |
215 | } // namespace internal |
216 | } // namespace ops |
217 | } // namespace tensorflow |
218 | |
219 | #endif // TENSORFLOW_CC_OPS_CONTROL_FLOW_OPS_INTERNAL_H_ |
220 | |