1 | // This file is MACHINE GENERATED! Do not edit. |
2 | |
3 | #ifndef TENSORFLOW_CC_OPS_FUNCTIONAL_OPS_H_ |
4 | #define TENSORFLOW_CC_OPS_FUNCTIONAL_OPS_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 | |
18 | /// @defgroup functional_ops Functional Ops |
19 | /// @{ |
20 | |
21 | /// TODO: add doc. |
22 | /// |
23 | /// Args: |
24 | /// * scope: A Scope object |
25 | /// |
26 | /// Returns: |
27 | /// * `OutputList`: The output tensor. |
28 | class Case { |
29 | public: |
30 | /// Optional attribute setters for Case |
31 | struct Attrs { |
32 | /// Defaults to [] |
33 | TF_MUST_USE_RESULT Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
34 | Attrs ret = *this; |
35 | ret.output_shapes_ = x; |
36 | return ret; |
37 | } |
38 | |
39 | gtl::ArraySlice<PartialTensorShape> output_shapes_ = {}; |
40 | }; |
41 | Case(const ::tensorflow::Scope& scope, ::tensorflow::Input branch_index, |
42 | ::tensorflow::InputList input, const DataTypeSlice& Tout, const |
43 | gtl::ArraySlice<NameAttrList>& branches); |
44 | Case(const ::tensorflow::Scope& scope, ::tensorflow::Input branch_index, |
45 | ::tensorflow::InputList input, const DataTypeSlice& Tout, const |
46 | gtl::ArraySlice<NameAttrList>& branches, const Case::Attrs& attrs); |
47 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
48 | |
49 | |
50 | static Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
51 | return Attrs().OutputShapes(x); |
52 | } |
53 | |
54 | Operation operation; |
55 | ::tensorflow::OutputList output; |
56 | }; |
57 | |
58 | /// TODO: add doc. |
59 | /// |
60 | /// Args: |
61 | /// * scope: A Scope object |
62 | /// |
63 | /// Returns: |
64 | /// * `Output`: The index tensor. |
65 | class DeviceIndex { |
66 | public: |
67 | DeviceIndex(const ::tensorflow::Scope& scope, const |
68 | gtl::ArraySlice<::tensorflow::tstring>& device_names); |
69 | operator ::tensorflow::Output() const { return index; } |
70 | operator ::tensorflow::Input() const { return index; } |
71 | ::tensorflow::Node* node() const { return index.node(); } |
72 | |
73 | Operation operation; |
74 | ::tensorflow::Output index; |
75 | }; |
76 | |
77 | /// TODO: add doc. |
78 | /// |
79 | /// Args: |
80 | /// * scope: A Scope object |
81 | /// |
82 | /// Returns: |
83 | /// * `Output`: The output tensor. |
84 | class FakeParam { |
85 | public: |
86 | FakeParam(const ::tensorflow::Scope& scope, DataType dtype, PartialTensorShape |
87 | shape); |
88 | operator ::tensorflow::Output() const { return output; } |
89 | operator ::tensorflow::Input() const { return output; } |
90 | ::tensorflow::Node* node() const { return output.node(); } |
91 | |
92 | Operation operation; |
93 | ::tensorflow::Output output; |
94 | }; |
95 | |
96 | /// TODO: add doc. |
97 | /// |
98 | /// Args: |
99 | /// * scope: A Scope object |
100 | /// |
101 | /// Returns: |
102 | /// * `OutputList`: The output tensor. |
103 | class For { |
104 | public: |
105 | For(const ::tensorflow::Scope& scope, ::tensorflow::Input start, |
106 | ::tensorflow::Input limit, ::tensorflow::Input delta, |
107 | ::tensorflow::InputList input, const NameAttrList& body); |
108 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
109 | |
110 | |
111 | Operation operation; |
112 | ::tensorflow::OutputList output; |
113 | }; |
114 | |
115 | /// TODO: add doc. |
116 | /// |
117 | /// Args: |
118 | /// * scope: A Scope object |
119 | /// |
120 | /// Returns: |
121 | /// * `OutputList`: The output tensor. |
122 | class If { |
123 | public: |
124 | /// Optional attribute setters for If |
125 | struct Attrs { |
126 | /// Defaults to [] |
127 | TF_MUST_USE_RESULT Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
128 | Attrs ret = *this; |
129 | ret.output_shapes_ = x; |
130 | return ret; |
131 | } |
132 | |
133 | gtl::ArraySlice<PartialTensorShape> output_shapes_ = {}; |
134 | }; |
135 | If(const ::tensorflow::Scope& scope, ::tensorflow::Input cond, |
136 | ::tensorflow::InputList input, const DataTypeSlice& Tout, const |
137 | NameAttrList& then_branch, const NameAttrList& else_branch); |
138 | If(const ::tensorflow::Scope& scope, ::tensorflow::Input cond, |
139 | ::tensorflow::InputList input, const DataTypeSlice& Tout, const |
140 | NameAttrList& then_branch, const NameAttrList& else_branch, const If::Attrs& |
141 | attrs); |
142 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
143 | |
144 | |
145 | static Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
146 | return Attrs().OutputShapes(x); |
147 | } |
148 | |
149 | Operation operation; |
150 | ::tensorflow::OutputList output; |
151 | }; |
152 | |
153 | /// TODO: add doc. |
154 | /// |
155 | /// Args: |
156 | /// * scope: A Scope object |
157 | /// |
158 | /// Returns: |
159 | /// * `OutputList`: The output tensor. |
160 | class PartitionedCall { |
161 | public: |
162 | /// Optional attribute setters for PartitionedCall |
163 | struct Attrs { |
164 | /// Defaults to "" |
165 | TF_MUST_USE_RESULT Attrs Config(StringPiece x) { |
166 | Attrs ret = *this; |
167 | ret.config_ = x; |
168 | return ret; |
169 | } |
170 | |
171 | /// Defaults to "" |
172 | TF_MUST_USE_RESULT Attrs ConfigProto(StringPiece x) { |
173 | Attrs ret = *this; |
174 | ret.config_proto_ = x; |
175 | return ret; |
176 | } |
177 | |
178 | /// Defaults to "" |
179 | TF_MUST_USE_RESULT Attrs ExecutorType(StringPiece x) { |
180 | Attrs ret = *this; |
181 | ret.executor_type_ = x; |
182 | return ret; |
183 | } |
184 | |
185 | StringPiece config_ = "" ; |
186 | StringPiece config_proto_ = "" ; |
187 | StringPiece executor_type_ = "" ; |
188 | }; |
189 | PartitionedCall(const ::tensorflow::Scope& scope, ::tensorflow::InputList args, |
190 | const DataTypeSlice& Tout, const NameAttrList& f); |
191 | PartitionedCall(const ::tensorflow::Scope& scope, ::tensorflow::InputList args, |
192 | const DataTypeSlice& Tout, const NameAttrList& f, const |
193 | PartitionedCall::Attrs& attrs); |
194 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
195 | |
196 | |
197 | static Attrs Config(StringPiece x) { |
198 | return Attrs().Config(x); |
199 | } |
200 | static Attrs ConfigProto(StringPiece x) { |
201 | return Attrs().ConfigProto(x); |
202 | } |
203 | static Attrs ExecutorType(StringPiece x) { |
204 | return Attrs().ExecutorType(x); |
205 | } |
206 | |
207 | Operation operation; |
208 | ::tensorflow::OutputList output; |
209 | }; |
210 | |
211 | /// TODO: add doc. |
212 | /// |
213 | /// Args: |
214 | /// * scope: A Scope object |
215 | /// |
216 | /// Returns: |
217 | /// * `OutputList`: The output tensor. |
218 | class RemoteCall { |
219 | public: |
220 | RemoteCall(const ::tensorflow::Scope& scope, ::tensorflow::Input target, |
221 | ::tensorflow::InputList args, const DataTypeSlice& Tout, const |
222 | NameAttrList& f); |
223 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
224 | |
225 | |
226 | Operation operation; |
227 | ::tensorflow::OutputList output; |
228 | }; |
229 | |
230 | /// TODO: add doc. |
231 | /// |
232 | /// Args: |
233 | /// * scope: A Scope object |
234 | /// |
235 | /// Returns: |
236 | /// * `OutputList`: The output tensor. |
237 | class StatefulPartitionedCall { |
238 | public: |
239 | /// Optional attribute setters for StatefulPartitionedCall |
240 | struct Attrs { |
241 | /// Defaults to "" |
242 | TF_MUST_USE_RESULT Attrs Config(StringPiece x) { |
243 | Attrs ret = *this; |
244 | ret.config_ = x; |
245 | return ret; |
246 | } |
247 | |
248 | /// Defaults to "" |
249 | TF_MUST_USE_RESULT Attrs ConfigProto(StringPiece x) { |
250 | Attrs ret = *this; |
251 | ret.config_proto_ = x; |
252 | return ret; |
253 | } |
254 | |
255 | /// Defaults to "" |
256 | TF_MUST_USE_RESULT Attrs ExecutorType(StringPiece x) { |
257 | Attrs ret = *this; |
258 | ret.executor_type_ = x; |
259 | return ret; |
260 | } |
261 | |
262 | StringPiece config_ = "" ; |
263 | StringPiece config_proto_ = "" ; |
264 | StringPiece executor_type_ = "" ; |
265 | }; |
266 | StatefulPartitionedCall(const ::tensorflow::Scope& scope, |
267 | ::tensorflow::InputList args, const DataTypeSlice& |
268 | Tout, const NameAttrList& f); |
269 | StatefulPartitionedCall(const ::tensorflow::Scope& scope, |
270 | ::tensorflow::InputList args, const DataTypeSlice& |
271 | Tout, const NameAttrList& f, const |
272 | StatefulPartitionedCall::Attrs& attrs); |
273 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
274 | |
275 | |
276 | static Attrs Config(StringPiece x) { |
277 | return Attrs().Config(x); |
278 | } |
279 | static Attrs ConfigProto(StringPiece x) { |
280 | return Attrs().ConfigProto(x); |
281 | } |
282 | static Attrs ExecutorType(StringPiece x) { |
283 | return Attrs().ExecutorType(x); |
284 | } |
285 | |
286 | Operation operation; |
287 | ::tensorflow::OutputList output; |
288 | }; |
289 | |
290 | /// TODO: add doc. |
291 | /// |
292 | /// Args: |
293 | /// * scope: A Scope object |
294 | /// |
295 | /// Returns: |
296 | /// * `OutputList`: The output tensor. |
297 | class StatelessCase { |
298 | public: |
299 | /// Optional attribute setters for StatelessCase |
300 | struct Attrs { |
301 | /// Defaults to [] |
302 | TF_MUST_USE_RESULT Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
303 | Attrs ret = *this; |
304 | ret.output_shapes_ = x; |
305 | return ret; |
306 | } |
307 | |
308 | gtl::ArraySlice<PartialTensorShape> output_shapes_ = {}; |
309 | }; |
310 | StatelessCase(const ::tensorflow::Scope& scope, ::tensorflow::Input |
311 | branch_index, ::tensorflow::InputList input, const DataTypeSlice& |
312 | Tout, const gtl::ArraySlice<NameAttrList>& branches); |
313 | StatelessCase(const ::tensorflow::Scope& scope, ::tensorflow::Input |
314 | branch_index, ::tensorflow::InputList input, const DataTypeSlice& |
315 | Tout, const gtl::ArraySlice<NameAttrList>& branches, const |
316 | StatelessCase::Attrs& attrs); |
317 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
318 | |
319 | |
320 | static Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
321 | return Attrs().OutputShapes(x); |
322 | } |
323 | |
324 | Operation operation; |
325 | ::tensorflow::OutputList output; |
326 | }; |
327 | |
328 | /// TODO: add doc. |
329 | /// |
330 | /// Args: |
331 | /// * scope: A Scope object |
332 | /// |
333 | /// Returns: |
334 | /// * `OutputList`: The output tensor. |
335 | class StatelessIf { |
336 | public: |
337 | /// Optional attribute setters for StatelessIf |
338 | struct Attrs { |
339 | /// Defaults to [] |
340 | TF_MUST_USE_RESULT Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
341 | Attrs ret = *this; |
342 | ret.output_shapes_ = x; |
343 | return ret; |
344 | } |
345 | |
346 | gtl::ArraySlice<PartialTensorShape> output_shapes_ = {}; |
347 | }; |
348 | StatelessIf(const ::tensorflow::Scope& scope, ::tensorflow::Input cond, |
349 | ::tensorflow::InputList input, const DataTypeSlice& Tout, const |
350 | NameAttrList& then_branch, const NameAttrList& else_branch); |
351 | StatelessIf(const ::tensorflow::Scope& scope, ::tensorflow::Input cond, |
352 | ::tensorflow::InputList input, const DataTypeSlice& Tout, const |
353 | NameAttrList& then_branch, const NameAttrList& else_branch, const |
354 | StatelessIf::Attrs& attrs); |
355 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
356 | |
357 | |
358 | static Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
359 | return Attrs().OutputShapes(x); |
360 | } |
361 | |
362 | Operation operation; |
363 | ::tensorflow::OutputList output; |
364 | }; |
365 | |
366 | /// TODO: add doc. |
367 | /// |
368 | /// Args: |
369 | /// * scope: A Scope object |
370 | /// |
371 | /// Returns: |
372 | /// * `OutputList`: The output tensor. |
373 | class StatelessWhile { |
374 | public: |
375 | /// Optional attribute setters for StatelessWhile |
376 | struct Attrs { |
377 | /// Defaults to [] |
378 | TF_MUST_USE_RESULT Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
379 | Attrs ret = *this; |
380 | ret.output_shapes_ = x; |
381 | return ret; |
382 | } |
383 | |
384 | /// Defaults to 10 |
385 | TF_MUST_USE_RESULT Attrs ParallelIterations(int64 x) { |
386 | Attrs ret = *this; |
387 | ret.parallel_iterations_ = x; |
388 | return ret; |
389 | } |
390 | |
391 | gtl::ArraySlice<PartialTensorShape> output_shapes_ = {}; |
392 | int64 parallel_iterations_ = 10; |
393 | }; |
394 | StatelessWhile(const ::tensorflow::Scope& scope, ::tensorflow::InputList input, |
395 | const NameAttrList& cond, const NameAttrList& body); |
396 | StatelessWhile(const ::tensorflow::Scope& scope, ::tensorflow::InputList input, |
397 | const NameAttrList& cond, const NameAttrList& body, const |
398 | StatelessWhile::Attrs& attrs); |
399 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
400 | |
401 | |
402 | static Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
403 | return Attrs().OutputShapes(x); |
404 | } |
405 | static Attrs ParallelIterations(int64 x) { |
406 | return Attrs().ParallelIterations(x); |
407 | } |
408 | |
409 | Operation operation; |
410 | ::tensorflow::OutputList output; |
411 | }; |
412 | |
413 | /// TODO: add doc. |
414 | /// |
415 | /// Args: |
416 | /// * scope: A Scope object |
417 | /// |
418 | /// Returns: |
419 | /// * `OutputList`: The output tensor. |
420 | class SymbolicGradient { |
421 | public: |
422 | SymbolicGradient(const ::tensorflow::Scope& scope, ::tensorflow::InputList |
423 | input, const DataTypeSlice& Tout, const NameAttrList& f); |
424 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
425 | |
426 | |
427 | Operation operation; |
428 | ::tensorflow::OutputList output; |
429 | }; |
430 | |
431 | /// TODO: add doc. |
432 | /// |
433 | /// Args: |
434 | /// * scope: A Scope object |
435 | /// |
436 | /// Returns: |
437 | /// * `Output`: The output tensor. |
438 | class ToBool { |
439 | public: |
440 | ToBool(const ::tensorflow::Scope& scope, ::tensorflow::Input input); |
441 | operator ::tensorflow::Output() const { return output; } |
442 | operator ::tensorflow::Input() const { return output; } |
443 | ::tensorflow::Node* node() const { return output.node(); } |
444 | |
445 | Operation operation; |
446 | ::tensorflow::Output output; |
447 | }; |
448 | |
449 | /// TODO: add doc. |
450 | /// |
451 | /// Args: |
452 | /// * scope: A Scope object |
453 | /// |
454 | /// Returns: |
455 | /// * `OutputList`: The output tensor. |
456 | class While { |
457 | public: |
458 | /// Optional attribute setters for While |
459 | struct Attrs { |
460 | /// Defaults to [] |
461 | TF_MUST_USE_RESULT Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
462 | Attrs ret = *this; |
463 | ret.output_shapes_ = x; |
464 | return ret; |
465 | } |
466 | |
467 | /// Defaults to 10 |
468 | TF_MUST_USE_RESULT Attrs ParallelIterations(int64 x) { |
469 | Attrs ret = *this; |
470 | ret.parallel_iterations_ = x; |
471 | return ret; |
472 | } |
473 | |
474 | gtl::ArraySlice<PartialTensorShape> output_shapes_ = {}; |
475 | int64 parallel_iterations_ = 10; |
476 | }; |
477 | While(const ::tensorflow::Scope& scope, ::tensorflow::InputList input, const |
478 | NameAttrList& cond, const NameAttrList& body); |
479 | While(const ::tensorflow::Scope& scope, ::tensorflow::InputList input, const |
480 | NameAttrList& cond, const NameAttrList& body, const While::Attrs& attrs); |
481 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
482 | |
483 | |
484 | static Attrs OutputShapes(const gtl::ArraySlice<PartialTensorShape>& x) { |
485 | return Attrs().OutputShapes(x); |
486 | } |
487 | static Attrs ParallelIterations(int64 x) { |
488 | return Attrs().ParallelIterations(x); |
489 | } |
490 | |
491 | Operation operation; |
492 | ::tensorflow::OutputList output; |
493 | }; |
494 | |
495 | /// output = cond ? then_branch(input) : else_branch(input) |
496 | /// |
497 | /// Args: |
498 | /// * scope: A Scope object |
499 | /// * cond: A Tensor. If the tensor is a scalar of non-boolean type, the |
500 | /// scalar is converted to a boolean according to the |
501 | /// following rule: if the scalar is a numerical value, non-zero means |
502 | /// True and zero means False; if the scalar is a string, non-empty |
503 | /// means True and empty means False. If the tensor is not a scalar, |
504 | /// being empty means False and being non-empty means True. |
505 | /// * input: A list of input tensors. |
506 | /// * then_branch: A function that takes 'inputs' and returns a list of |
507 | /// tensors, whose types are the same as what else_branch returns. |
508 | /// * else_branch: A function that takes 'inputs' and returns a list of |
509 | /// tensors. whose types are the same as what then_branch returns. |
510 | /// |
511 | /// Returns: |
512 | /// * `OutputList`: The output tensor. |
513 | class _If { |
514 | public: |
515 | _If(const ::tensorflow::Scope& scope, ::tensorflow::Input cond, |
516 | ::tensorflow::InputList input, const DataTypeSlice& Tout, const |
517 | NameAttrList& then_branch, const NameAttrList& else_branch); |
518 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
519 | |
520 | |
521 | Operation operation; |
522 | ::tensorflow::OutputList output; |
523 | }; |
524 | |
525 | /// output = input; While (Cond(output)) { output = Body(output) } |
526 | /// |
527 | /// Args: |
528 | /// * scope: A Scope object |
529 | /// * input: A list of input tensors whose types are T. |
530 | /// * cond: A function takes 'input' and returns a tensor. If the tensor is |
531 | /// a scalar of non-boolean, the scalar is converted to a boolean |
532 | /// according to the following rule: if the scalar is a numerical |
533 | /// value, non-zero means True and zero means False; if the scalar is |
534 | /// a string, non-empty means True and empty means False. If the |
535 | /// tensor is not a scalar, non-emptiness means True and False |
536 | /// otherwise. |
537 | /// * body: A function that takes a list of tensors and returns another |
538 | /// list of tensors. Both lists have the same types as specified |
539 | /// by T. |
540 | /// |
541 | /// Returns: |
542 | /// * `OutputList`: A list of output tensors whose types are T. |
543 | class _While { |
544 | public: |
545 | _While(const ::tensorflow::Scope& scope, ::tensorflow::InputList input, const |
546 | NameAttrList& cond, const NameAttrList& body); |
547 | ::tensorflow::Output operator[](size_t index) const { return output[index]; } |
548 | |
549 | |
550 | Operation operation; |
551 | ::tensorflow::OutputList output; |
552 | }; |
553 | |
554 | /// @} |
555 | |
556 | } // namespace ops |
557 | } // namespace tensorflow |
558 | |
559 | #endif // TENSORFLOW_CC_OPS_FUNCTIONAL_OPS_H_ |
560 | |