1 | // This file is MACHINE GENERATED! Do not edit. |
2 | |
3 | #ifndef TENSORFLOW_CC_OPS_LIST_OPS_H_ |
4 | #define TENSORFLOW_CC_OPS_LIST_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 list_ops List Ops |
19 | /// @{ |
20 | |
21 | /// Creates and returns an empty tensor list. |
22 | /// |
23 | /// All list elements must be tensors of dtype element_dtype and shape compatible |
24 | /// with element_shape. |
25 | /// |
26 | /// handle: an empty tensor list. |
27 | /// element_dtype: the type of elements in the list. |
28 | /// element_shape: a shape compatible with that of elements in the list. |
29 | /// |
30 | /// Args: |
31 | /// * scope: A Scope object |
32 | /// |
33 | /// Returns: |
34 | /// * `Output`: The handle tensor. |
35 | class EmptyTensorList { |
36 | public: |
37 | EmptyTensorList(const ::tensorflow::Scope& scope, ::tensorflow::Input |
38 | element_shape, ::tensorflow::Input max_num_elements, DataType |
39 | element_dtype); |
40 | operator ::tensorflow::Output() const { return handle; } |
41 | operator ::tensorflow::Input() const { return handle; } |
42 | ::tensorflow::Node* node() const { return handle.node(); } |
43 | |
44 | Operation operation; |
45 | ::tensorflow::Output handle; |
46 | }; |
47 | |
48 | /// Concats all tensors in the list along the 0th dimension. |
49 | /// |
50 | /// Requires that all tensors have the same shape except the first dimension. |
51 | /// |
52 | /// input_handle: The input list. |
53 | /// tensor: The concated result. |
54 | /// lengths: Output tensor containing sizes of the 0th dimension of tensors in the list, used for computing the gradient. |
55 | /// |
56 | /// |
57 | /// Args: |
58 | /// * scope: A Scope object |
59 | /// |
60 | /// Returns: |
61 | /// * `Output` tensor |
62 | /// * `Output` lengths |
63 | class TensorListConcat { |
64 | public: |
65 | /// Optional attribute setters for TensorListConcat |
66 | struct Attrs { |
67 | /// Defaults to <unknown> |
68 | TF_MUST_USE_RESULT Attrs ElementShape(PartialTensorShape x) { |
69 | Attrs ret = *this; |
70 | ret.element_shape_ = x; |
71 | return ret; |
72 | } |
73 | |
74 | PartialTensorShape element_shape_ = ::tensorflow::PartialTensorShape() /* unknown */; |
75 | }; |
76 | TensorListConcat(const ::tensorflow::Scope& scope, ::tensorflow::Input |
77 | input_handle, DataType element_dtype); |
78 | TensorListConcat(const ::tensorflow::Scope& scope, ::tensorflow::Input |
79 | input_handle, DataType element_dtype, const |
80 | TensorListConcat::Attrs& attrs); |
81 | |
82 | static Attrs ElementShape(PartialTensorShape x) { |
83 | return Attrs().ElementShape(x); |
84 | } |
85 | |
86 | Operation operation; |
87 | ::tensorflow::Output tensor; |
88 | ::tensorflow::Output lengths; |
89 | }; |
90 | |
91 | /// TODO: add doc. |
92 | /// |
93 | /// Args: |
94 | /// * scope: A Scope object |
95 | /// |
96 | /// Returns: |
97 | /// * `Output`: The output tensor. |
98 | class TensorListConcatLists { |
99 | public: |
100 | TensorListConcatLists(const ::tensorflow::Scope& scope, ::tensorflow::Input |
101 | input_a, ::tensorflow::Input input_b, DataType |
102 | element_dtype); |
103 | operator ::tensorflow::Output() const { return output; } |
104 | operator ::tensorflow::Input() const { return output; } |
105 | ::tensorflow::Node* node() const { return output.node(); } |
106 | |
107 | Operation operation; |
108 | ::tensorflow::Output output; |
109 | }; |
110 | |
111 | /// Concats all tensors in the list along the 0th dimension. |
112 | /// |
113 | /// Requires that all tensors have the same shape except the first dimension. |
114 | /// |
115 | /// input_handle: The input list. |
116 | /// element_shape: The shape of the uninitialized elements in the list. If the first |
117 | /// dimension is not -1, it is assumed that all list elements have the same |
118 | /// leading dim. |
119 | /// leading_dims: The list of leading dims of uninitialized list elements. Used if |
120 | /// the leading dim of input_handle.element_shape or the element_shape input arg |
121 | /// is not already set. |
122 | /// tensor: The concated result. |
123 | /// lengths: Output tensor containing sizes of the 0th dimension of tensors in the list, used for computing the gradient. |
124 | /// |
125 | /// |
126 | /// Args: |
127 | /// * scope: A Scope object |
128 | /// |
129 | /// Returns: |
130 | /// * `Output` tensor |
131 | /// * `Output` lengths |
132 | class TensorListConcatV2 { |
133 | public: |
134 | TensorListConcatV2(const ::tensorflow::Scope& scope, ::tensorflow::Input |
135 | input_handle, ::tensorflow::Input element_shape, |
136 | ::tensorflow::Input leading_dims, DataType element_dtype); |
137 | |
138 | Operation operation; |
139 | ::tensorflow::Output tensor; |
140 | ::tensorflow::Output lengths; |
141 | }; |
142 | |
143 | /// The shape of the elements of the given list, as a tensor. |
144 | /// |
145 | /// input_handle: the list |
146 | /// element_shape: the shape of elements of the list |
147 | /// |
148 | /// Args: |
149 | /// * scope: A Scope object |
150 | /// |
151 | /// Returns: |
152 | /// * `Output`: The element_shape tensor. |
153 | class TensorListElementShape { |
154 | public: |
155 | TensorListElementShape(const ::tensorflow::Scope& scope, ::tensorflow::Input |
156 | input_handle, DataType shape_type); |
157 | operator ::tensorflow::Output() const { return element_shape; } |
158 | operator ::tensorflow::Input() const { return element_shape; } |
159 | ::tensorflow::Node* node() const { return element_shape.node(); } |
160 | |
161 | Operation operation; |
162 | ::tensorflow::Output element_shape; |
163 | }; |
164 | |
165 | /// Creates a TensorList which, when stacked, has the value of `tensor`. |
166 | /// |
167 | /// Each tensor in the result list corresponds to one row of the input tensor. |
168 | /// |
169 | /// tensor: The input tensor. |
170 | /// output_handle: The list. |
171 | /// |
172 | /// Args: |
173 | /// * scope: A Scope object |
174 | /// |
175 | /// Returns: |
176 | /// * `Output`: The output_handle tensor. |
177 | class TensorListFromTensor { |
178 | public: |
179 | TensorListFromTensor(const ::tensorflow::Scope& scope, ::tensorflow::Input |
180 | tensor, ::tensorflow::Input element_shape); |
181 | operator ::tensorflow::Output() const { return output_handle; } |
182 | operator ::tensorflow::Input() const { return output_handle; } |
183 | ::tensorflow::Node* node() const { return output_handle.node(); } |
184 | |
185 | Operation operation; |
186 | ::tensorflow::Output output_handle; |
187 | }; |
188 | |
189 | /// Creates a Tensor by indexing into the TensorList. |
190 | /// |
191 | /// Each row in the produced Tensor corresponds to the element in the TensorList |
192 | /// specified by the given index (see `tf.gather`). |
193 | /// |
194 | /// input_handle: The input tensor list. |
195 | /// indices: The indices used to index into the list. |
196 | /// values: The tensor. |
197 | /// |
198 | /// Args: |
199 | /// * scope: A Scope object |
200 | /// |
201 | /// Returns: |
202 | /// * `Output`: The values tensor. |
203 | class TensorListGather { |
204 | public: |
205 | TensorListGather(const ::tensorflow::Scope& scope, ::tensorflow::Input |
206 | input_handle, ::tensorflow::Input indices, ::tensorflow::Input |
207 | element_shape, DataType element_dtype); |
208 | operator ::tensorflow::Output() const { return values; } |
209 | operator ::tensorflow::Input() const { return values; } |
210 | ::tensorflow::Node* node() const { return values.node(); } |
211 | |
212 | Operation operation; |
213 | ::tensorflow::Output values; |
214 | }; |
215 | |
216 | /// TODO: add doc. |
217 | /// |
218 | /// Args: |
219 | /// * scope: A Scope object |
220 | /// |
221 | /// Returns: |
222 | /// * `Output`: The item tensor. |
223 | class TensorListGetItem { |
224 | public: |
225 | TensorListGetItem(const ::tensorflow::Scope& scope, ::tensorflow::Input |
226 | input_handle, ::tensorflow::Input index, ::tensorflow::Input |
227 | element_shape, DataType element_dtype); |
228 | operator ::tensorflow::Output() const { return item; } |
229 | operator ::tensorflow::Input() const { return item; } |
230 | ::tensorflow::Node* node() const { return item.node(); } |
231 | |
232 | Operation operation; |
233 | ::tensorflow::Output item; |
234 | }; |
235 | |
236 | /// Returns the number of tensors in the input tensor list. |
237 | /// |
238 | /// input_handle: the input list |
239 | /// length: the number of tensors in the list |
240 | /// |
241 | /// Args: |
242 | /// * scope: A Scope object |
243 | /// |
244 | /// Returns: |
245 | /// * `Output`: The length tensor. |
246 | class TensorListLength { |
247 | public: |
248 | TensorListLength(const ::tensorflow::Scope& scope, ::tensorflow::Input |
249 | input_handle); |
250 | operator ::tensorflow::Output() const { return length; } |
251 | operator ::tensorflow::Input() const { return length; } |
252 | ::tensorflow::Node* node() const { return length.node(); } |
253 | |
254 | Operation operation; |
255 | ::tensorflow::Output length; |
256 | }; |
257 | |
258 | /// Returns the last element of the input list as well as a list with all but that element. |
259 | /// |
260 | /// Fails if the list is empty. |
261 | /// |
262 | /// input_handle: the input list |
263 | /// tensor: the withdrawn last element of the list |
264 | /// element_dtype: the type of elements in the list |
265 | /// element_shape: the shape of the output tensor |
266 | /// |
267 | /// Args: |
268 | /// * scope: A Scope object |
269 | /// |
270 | /// Returns: |
271 | /// * `Output` output_handle |
272 | /// * `Output` tensor |
273 | class TensorListPopBack { |
274 | public: |
275 | TensorListPopBack(const ::tensorflow::Scope& scope, ::tensorflow::Input |
276 | input_handle, ::tensorflow::Input element_shape, DataType |
277 | element_dtype); |
278 | |
279 | Operation operation; |
280 | ::tensorflow::Output output_handle; |
281 | ::tensorflow::Output tensor; |
282 | }; |
283 | |
284 | /// Returns a list which has the passed-in `Tensor` as last element and the other elements of the given list in `input_handle`. |
285 | /// |
286 | /// tensor: The tensor to put on the list. |
287 | /// input_handle: The old list. |
288 | /// output_handle: A list with the elements of the old list followed by tensor. |
289 | /// element_dtype: the type of elements in the list. |
290 | /// element_shape: a shape compatible with that of elements in the list. |
291 | /// |
292 | /// Args: |
293 | /// * scope: A Scope object |
294 | /// |
295 | /// Returns: |
296 | /// * `Output`: The output_handle tensor. |
297 | class TensorListPushBack { |
298 | public: |
299 | TensorListPushBack(const ::tensorflow::Scope& scope, ::tensorflow::Input |
300 | input_handle, ::tensorflow::Input tensor); |
301 | operator ::tensorflow::Output() const { return output_handle; } |
302 | operator ::tensorflow::Input() const { return output_handle; } |
303 | ::tensorflow::Node* node() const { return output_handle.node(); } |
304 | |
305 | Operation operation; |
306 | ::tensorflow::Output output_handle; |
307 | }; |
308 | |
309 | /// TODO: add doc. |
310 | /// |
311 | /// Args: |
312 | /// * scope: A Scope object |
313 | /// |
314 | /// Returns: |
315 | /// * `Output`: The output_handles tensor. |
316 | class TensorListPushBackBatch { |
317 | public: |
318 | TensorListPushBackBatch(const ::tensorflow::Scope& scope, ::tensorflow::Input |
319 | input_handles, ::tensorflow::Input tensor); |
320 | operator ::tensorflow::Output() const { return output_handles; } |
321 | operator ::tensorflow::Input() const { return output_handles; } |
322 | ::tensorflow::Node* node() const { return output_handles.node(); } |
323 | |
324 | Operation operation; |
325 | ::tensorflow::Output output_handles; |
326 | }; |
327 | |
328 | /// List of the given size with empty elements. |
329 | /// |
330 | /// element_shape: the shape of the future elements of the list |
331 | /// num_elements: the number of elements to reserve |
332 | /// handle: the output list |
333 | /// element_dtype: the desired type of elements in the list. |
334 | /// |
335 | /// Args: |
336 | /// * scope: A Scope object |
337 | /// |
338 | /// Returns: |
339 | /// * `Output`: The handle tensor. |
340 | class TensorListReserve { |
341 | public: |
342 | TensorListReserve(const ::tensorflow::Scope& scope, ::tensorflow::Input |
343 | element_shape, ::tensorflow::Input num_elements, DataType |
344 | element_dtype); |
345 | operator ::tensorflow::Output() const { return handle; } |
346 | operator ::tensorflow::Input() const { return handle; } |
347 | ::tensorflow::Node* node() const { return handle.node(); } |
348 | |
349 | Operation operation; |
350 | ::tensorflow::Output handle; |
351 | }; |
352 | |
353 | /// Resizes the list. |
354 | /// |
355 | /// |
356 | /// input_handle: the input list |
357 | /// size: size of the output list |
358 | /// |
359 | /// |
360 | /// Args: |
361 | /// * scope: A Scope object |
362 | /// |
363 | /// Returns: |
364 | /// * `Output`: The output_handle tensor. |
365 | class TensorListResize { |
366 | public: |
367 | TensorListResize(const ::tensorflow::Scope& scope, ::tensorflow::Input |
368 | input_handle, ::tensorflow::Input size); |
369 | operator ::tensorflow::Output() const { return output_handle; } |
370 | operator ::tensorflow::Input() const { return output_handle; } |
371 | ::tensorflow::Node* node() const { return output_handle.node(); } |
372 | |
373 | Operation operation; |
374 | ::tensorflow::Output output_handle; |
375 | }; |
376 | |
377 | /// Creates a TensorList by indexing into a Tensor. |
378 | /// |
379 | /// Each member of the TensorList corresponds to one row of the input tensor, |
380 | /// specified by the given index (see `tf.gather`). |
381 | /// |
382 | /// tensor: The input tensor. |
383 | /// indices: The indices used to index into the list. |
384 | /// element_shape: The shape of the elements in the list (can be less specified than |
385 | /// the shape of the tensor). |
386 | /// output_handle: The TensorList. |
387 | /// |
388 | /// Args: |
389 | /// * scope: A Scope object |
390 | /// |
391 | /// Returns: |
392 | /// * `Output`: The output_handle tensor. |
393 | class TensorListScatter { |
394 | public: |
395 | TensorListScatter(const ::tensorflow::Scope& scope, ::tensorflow::Input tensor, |
396 | ::tensorflow::Input indices, ::tensorflow::Input |
397 | element_shape); |
398 | operator ::tensorflow::Output() const { return output_handle; } |
399 | operator ::tensorflow::Input() const { return output_handle; } |
400 | ::tensorflow::Node* node() const { return output_handle.node(); } |
401 | |
402 | Operation operation; |
403 | ::tensorflow::Output output_handle; |
404 | }; |
405 | |
406 | /// Scatters tensor at indices in an input list. |
407 | /// |
408 | /// Each member of the TensorList corresponds to one row of the input tensor, |
409 | /// specified by the given index (see `tf.gather`). |
410 | /// |
411 | /// input_handle: The list to scatter into. |
412 | /// tensor: The input tensor. |
413 | /// indices: The indices used to index into the list. |
414 | /// output_handle: The TensorList. |
415 | /// |
416 | /// Args: |
417 | /// * scope: A Scope object |
418 | /// |
419 | /// Returns: |
420 | /// * `Output`: The output_handle tensor. |
421 | class TensorListScatterIntoExistingList { |
422 | public: |
423 | TensorListScatterIntoExistingList(const ::tensorflow::Scope& scope, |
424 | ::tensorflow::Input input_handle, |
425 | ::tensorflow::Input tensor, |
426 | ::tensorflow::Input indices); |
427 | operator ::tensorflow::Output() const { return output_handle; } |
428 | operator ::tensorflow::Input() const { return output_handle; } |
429 | ::tensorflow::Node* node() const { return output_handle.node(); } |
430 | |
431 | Operation operation; |
432 | ::tensorflow::Output output_handle; |
433 | }; |
434 | |
435 | /// Creates a TensorList by indexing into a Tensor. |
436 | /// |
437 | /// Each member of the TensorList corresponds to one row of the input tensor, |
438 | /// specified by the given index (see `tf.gather`). |
439 | /// |
440 | /// tensor: The input tensor. |
441 | /// indices: The indices used to index into the list. |
442 | /// element_shape: The shape of the elements in the list (can be less specified than |
443 | /// the shape of the tensor). |
444 | /// num_elements: The size of the output list. Must be large enough to accommodate |
445 | /// the largest index in indices. If -1, the list is just large enough to include |
446 | /// the largest index in indices. |
447 | /// output_handle: The TensorList. |
448 | /// |
449 | /// Args: |
450 | /// * scope: A Scope object |
451 | /// |
452 | /// Returns: |
453 | /// * `Output`: The output_handle tensor. |
454 | class TensorListScatterV2 { |
455 | public: |
456 | TensorListScatterV2(const ::tensorflow::Scope& scope, ::tensorflow::Input |
457 | tensor, ::tensorflow::Input indices, ::tensorflow::Input |
458 | element_shape, ::tensorflow::Input num_elements); |
459 | operator ::tensorflow::Output() const { return output_handle; } |
460 | operator ::tensorflow::Input() const { return output_handle; } |
461 | ::tensorflow::Node* node() const { return output_handle.node(); } |
462 | |
463 | Operation operation; |
464 | ::tensorflow::Output output_handle; |
465 | }; |
466 | |
467 | /// TODO: add doc. |
468 | /// |
469 | /// Args: |
470 | /// * scope: A Scope object |
471 | /// |
472 | /// Returns: |
473 | /// * `Output`: The output_handle tensor. |
474 | class TensorListSetItem { |
475 | public: |
476 | TensorListSetItem(const ::tensorflow::Scope& scope, ::tensorflow::Input |
477 | input_handle, ::tensorflow::Input index, ::tensorflow::Input |
478 | item); |
479 | operator ::tensorflow::Output() const { return output_handle; } |
480 | operator ::tensorflow::Input() const { return output_handle; } |
481 | ::tensorflow::Node* node() const { return output_handle.node(); } |
482 | |
483 | Operation operation; |
484 | ::tensorflow::Output output_handle; |
485 | }; |
486 | |
487 | /// Splits a tensor into a list. |
488 | /// |
489 | /// list[i] corresponds to lengths[i] tensors from the input tensor. |
490 | /// The tensor must have rank at least 1 and contain exactly sum(lengths) elements. |
491 | /// |
492 | /// tensor: The input tensor. |
493 | /// element_shape: A shape compatible with that of elements in the tensor. |
494 | /// lengths: Vector of sizes of the 0th dimension of tensors in the list. |
495 | /// output_handle: The list. |
496 | /// |
497 | /// Args: |
498 | /// * scope: A Scope object |
499 | /// |
500 | /// Returns: |
501 | /// * `Output`: The output_handle tensor. |
502 | class TensorListSplit { |
503 | public: |
504 | TensorListSplit(const ::tensorflow::Scope& scope, ::tensorflow::Input tensor, |
505 | ::tensorflow::Input element_shape, ::tensorflow::Input lengths); |
506 | operator ::tensorflow::Output() const { return output_handle; } |
507 | operator ::tensorflow::Input() const { return output_handle; } |
508 | ::tensorflow::Node* node() const { return output_handle.node(); } |
509 | |
510 | Operation operation; |
511 | ::tensorflow::Output output_handle; |
512 | }; |
513 | |
514 | /// Stacks all tensors in the list. |
515 | /// |
516 | /// Requires that all tensors have the same shape. |
517 | /// |
518 | /// input_handle: the input list |
519 | /// tensor: the gathered result |
520 | /// num_elements: optional. If not -1, the number of elements in the list. |
521 | /// |
522 | /// |
523 | /// Args: |
524 | /// * scope: A Scope object |
525 | /// |
526 | /// Returns: |
527 | /// * `Output`: The tensor tensor. |
528 | class TensorListStack { |
529 | public: |
530 | /// Optional attribute setters for TensorListStack |
531 | struct Attrs { |
532 | /// Defaults to -1 |
533 | TF_MUST_USE_RESULT Attrs NumElements(int64 x) { |
534 | Attrs ret = *this; |
535 | ret.num_elements_ = x; |
536 | return ret; |
537 | } |
538 | |
539 | int64 num_elements_ = -1; |
540 | }; |
541 | TensorListStack(const ::tensorflow::Scope& scope, ::tensorflow::Input |
542 | input_handle, ::tensorflow::Input element_shape, DataType |
543 | element_dtype); |
544 | TensorListStack(const ::tensorflow::Scope& scope, ::tensorflow::Input |
545 | input_handle, ::tensorflow::Input element_shape, DataType |
546 | element_dtype, const TensorListStack::Attrs& attrs); |
547 | operator ::tensorflow::Output() const { return tensor; } |
548 | operator ::tensorflow::Input() const { return tensor; } |
549 | ::tensorflow::Node* node() const { return tensor.node(); } |
550 | |
551 | static Attrs NumElements(int64 x) { |
552 | return Attrs().NumElements(x); |
553 | } |
554 | |
555 | Operation operation; |
556 | ::tensorflow::Output tensor; |
557 | }; |
558 | |
559 | /// @} |
560 | |
561 | } // namespace ops |
562 | } // namespace tensorflow |
563 | |
564 | #endif // TENSORFLOW_CC_OPS_LIST_OPS_H_ |
565 | |