1 | // This file is MACHINE GENERATED! Do not edit. |
2 | |
3 | #ifndef TENSORFLOW_CC_OPS_MANIP_OPS_H_ |
4 | #define TENSORFLOW_CC_OPS_MANIP_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 manip_ops Manip Ops |
19 | /// @{ |
20 | |
21 | /// Rolls the elements of a tensor along an axis. |
22 | /// |
23 | /// The elements are shifted positively (towards larger indices) by the offset of |
24 | /// `shift` along the dimension of `axis`. Negative `shift` values will shift |
25 | /// elements in the opposite direction. Elements that roll passed the last position |
26 | /// will wrap around to the first and vice versa. Multiple shifts along multiple |
27 | /// axes may be specified. |
28 | /// |
29 | /// For example: |
30 | /// |
31 | /// ``` |
32 | /// # 't' is [0, 1, 2, 3, 4] |
33 | /// roll(t, shift=2, axis=0) ==> [3, 4, 0, 1, 2] |
34 | /// |
35 | /// # shifting along multiple dimensions |
36 | /// # 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]] |
37 | /// roll(t, shift=[1, -2], axis=[0, 1]) ==> [[7, 8, 9, 5, 6], [2, 3, 4, 0, 1]] |
38 | /// |
39 | /// # shifting along the same axis multiple times |
40 | /// # 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]] |
41 | /// roll(t, shift=[2, -3], axis=[1, 1]) ==> [[1, 2, 3, 4, 0], [6, 7, 8, 9, 5]] |
42 | /// ``` |
43 | /// |
44 | /// Args: |
45 | /// * scope: A Scope object |
46 | /// * shift: Dimension must be 0-D or 1-D. `shift[i]` specifies the number of places by which |
47 | /// elements are shifted positively (towards larger indices) along the dimension |
48 | /// specified by `axis[i]`. Negative shifts will roll the elements in the opposite |
49 | /// direction. |
50 | /// * axis: Dimension must be 0-D or 1-D. `axis[i]` specifies the dimension that the shift |
51 | /// `shift[i]` should occur. If the same axis is referenced more than once, the |
52 | /// total shift for that axis will be the sum of all the shifts that belong to that |
53 | /// axis. |
54 | /// |
55 | /// Returns: |
56 | /// * `Output`: Has the same shape and size as the input. The elements are shifted |
57 | /// positively (towards larger indices) by the offsets of `shift` along the |
58 | /// dimensions of `axis`. |
59 | class Roll { |
60 | public: |
61 | Roll(const ::tensorflow::Scope& scope, ::tensorflow::Input input, |
62 | ::tensorflow::Input shift, ::tensorflow::Input axis); |
63 | operator ::tensorflow::Output() const { return output; } |
64 | operator ::tensorflow::Input() const { return output; } |
65 | ::tensorflow::Node* node() const { return output.node(); } |
66 | |
67 | Operation operation; |
68 | ::tensorflow::Output output; |
69 | }; |
70 | |
71 | /// @} |
72 | |
73 | } // namespace ops |
74 | } // namespace tensorflow |
75 | |
76 | #endif // TENSORFLOW_CC_OPS_MANIP_OPS_H_ |
77 | |