1// This file is MACHINE GENERATED! Do not edit.
2
3#ifndef TENSORFLOW_CC_OPS_ARRAY_OPS_INTERNAL_H_
4#define TENSORFLOW_CC_OPS_ARRAY_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
15namespace tensorflow {
16namespace ops {
17namespace internal {
18// NOTE: This namespace has internal TensorFlow details that
19// are not part of TensorFlow's public API.
20
21/// @defgroup array_ops_internal Array Ops Internal
22/// @{
23
24/// Return the reduction indices for computing gradients of s0 op s1 with broadcast.
25///
26/// This is typically used by gradient computations for a broadcasting operation.
27///
28/// Args:
29/// * scope: A Scope object
30///
31/// Returns:
32/// * `Output` r0
33/// * `Output` r1
34class BroadcastGradientArgs {
35 public:
36 BroadcastGradientArgs(const ::tensorflow::Scope& scope, ::tensorflow::Input s0,
37 ::tensorflow::Input s1);
38
39 Operation operation;
40 ::tensorflow::Output r0;
41 ::tensorflow::Output r1;
42};
43
44/// Checks a tensor for NaN, -Inf and +Inf values.
45///
46/// When run, reports an `InvalidArgument` error if `tensor` has any values
47/// that are not a number (NaN) or infinity (Inf). Otherwise, returns the input
48/// tensor. Unlike CheckNumerics (V1), CheckNumericsV2 distinguishes -Inf and +Inf
49/// in the errors it throws.
50///
51/// Args:
52/// * scope: A Scope object
53/// * message: Prefix of the error message.
54///
55/// Returns:
56/// * `Output`: The output tensor.
57class CheckNumericsV2 {
58 public:
59 CheckNumericsV2(const ::tensorflow::Scope& scope, ::tensorflow::Input tensor,
60 StringPiece message);
61 operator ::tensorflow::Output() const { return output; }
62 operator ::tensorflow::Input() const { return output; }
63 ::tensorflow::Node* node() const { return output.node(); }
64
65 Operation operation;
66 ::tensorflow::Output output;
67};
68
69/// Applies lower_bound(sorted_search_values, values) along each row.
70///
71/// Each set of rows with the same index in (sorted_inputs, values) is treated
72/// independently. The resulting row is the equivalent of calling
73/// `np.searchsorted(sorted_inputs, values, side='left')`.
74///
75/// The result is not a global index to the entire
76/// `Tensor`, but rather just the index in the last dimension.
77///
78/// A 2-D example:
79/// sorted_sequence = [[0, 3, 9, 9, 10],
80/// [1, 2, 3, 4, 5]]
81/// values = [[2, 4, 9],
82/// [0, 2, 6]]
83///
84/// result = LowerBound(sorted_sequence, values)
85///
86/// result == [[1, 2, 2],
87/// [0, 1, 5]]
88///
89/// Args:
90/// * scope: A Scope object
91/// * sorted_inputs: 2-D Tensor where each row is ordered.
92/// * values: 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains
93/// the values that will be searched for in `sorted_search_values`.
94///
95/// Returns:
96/// * `Output`: A `Tensor` with the same shape as `values`. It contains the first scalar index
97/// into the last dimension where values can be inserted without changing the
98/// ordered property.
99class LowerBound {
100 public:
101 /// Optional attribute setters for LowerBound
102 struct Attrs {
103 /// Defaults to DT_INT32
104 TF_MUST_USE_RESULT Attrs OutType(DataType x) {
105 Attrs ret = *this;
106 ret.out_type_ = x;
107 return ret;
108 }
109
110 DataType out_type_ = DT_INT32;
111 };
112 LowerBound(const ::tensorflow::Scope& scope, ::tensorflow::Input sorted_inputs,
113 ::tensorflow::Input values);
114 LowerBound(const ::tensorflow::Scope& scope, ::tensorflow::Input sorted_inputs,
115 ::tensorflow::Input values, const LowerBound::Attrs& attrs);
116 operator ::tensorflow::Output() const { return output; }
117 operator ::tensorflow::Input() const { return output; }
118 ::tensorflow::Node* node() const { return output.node(); }
119
120 static Attrs OutType(DataType x) {
121 return Attrs().OutType(x);
122 }
123
124 Operation operation;
125 ::tensorflow::Output output;
126};
127
128/// Gradient op for `MirrorPad` op. This op folds a mirror-padded tensor.
129///
130/// This operation folds the padded areas of `input` by `MirrorPad` according to the
131/// `paddings` you specify. `paddings` must be the same as `paddings` argument
132/// given to the corresponding `MirrorPad` op.
133///
134/// The folded size of each dimension D of the output is:
135///
136/// `input.dim_size(D) - paddings(D, 0) - paddings(D, 1)`
137///
138/// For example:
139///
140/// ```
141/// # 't' is [[1, 2, 3], [4, 5, 6], [7, 8, 9]].
142/// # 'paddings' is [[0, 1]], [0, 1]].
143/// # 'mode' is SYMMETRIC.
144/// # rank of 't' is 2.
145/// pad(t, paddings) ==> [[ 1, 5]
146/// [11, 28]]
147/// ```
148///
149/// Args:
150/// * scope: A Scope object
151/// * input: The input tensor to be folded.
152/// * paddings: A two-column matrix specifying the padding sizes. The number of
153/// rows must be the same as the rank of `input`.
154/// * mode: The mode used in the `MirrorPad` op.
155///
156/// Returns:
157/// * `Output`: The folded tensor.
158class MirrorPadGrad {
159 public:
160 MirrorPadGrad(const ::tensorflow::Scope& scope, ::tensorflow::Input input,
161 ::tensorflow::Input paddings, StringPiece mode);
162 operator ::tensorflow::Output() const { return output; }
163 operator ::tensorflow::Input() const { return output; }
164 ::tensorflow::Node* node() const { return output.node(); }
165
166 Operation operation;
167 ::tensorflow::Output output;
168};
169
170/// Return the same ref tensor as the input ref tensor.
171///
172/// Args:
173/// * scope: A Scope object
174///
175/// Returns:
176/// * `Output`: The output tensor.
177class RefIdentity {
178 public:
179 RefIdentity(const ::tensorflow::Scope& scope, ::tensorflow::Input input);
180 operator ::tensorflow::Output() const { return output; }
181 operator ::tensorflow::Input() const { return output; }
182 ::tensorflow::Node* node() const { return output.node(); }
183
184 Operation operation;
185 ::tensorflow::Output output;
186};
187
188/// Applies upper_bound(sorted_search_values, values) along each row.
189///
190/// Each set of rows with the same index in (sorted_inputs, values) is treated
191/// independently. The resulting row is the equivalent of calling
192/// `np.searchsorted(sorted_inputs, values, side='right')`.
193///
194/// The result is not a global index to the entire
195/// `Tensor`, but rather just the index in the last dimension.
196///
197/// A 2-D example:
198/// sorted_sequence = [[0, 3, 9, 9, 10],
199/// [1, 2, 3, 4, 5]]
200/// values = [[2, 4, 9],
201/// [0, 2, 6]]
202///
203/// result = UpperBound(sorted_sequence, values)
204///
205/// result == [[1, 2, 4],
206/// [0, 2, 5]]
207///
208/// Args:
209/// * scope: A Scope object
210/// * sorted_inputs: 2-D Tensor where each row is ordered.
211/// * values: 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains
212/// the values that will be searched for in `sorted_search_values`.
213///
214/// Returns:
215/// * `Output`: A `Tensor` with the same shape as `values`. It contains the last scalar index
216/// into the last dimension where values can be inserted without changing the
217/// ordered property.
218class UpperBound {
219 public:
220 /// Optional attribute setters for UpperBound
221 struct Attrs {
222 /// Defaults to DT_INT32
223 TF_MUST_USE_RESULT Attrs OutType(DataType x) {
224 Attrs ret = *this;
225 ret.out_type_ = x;
226 return ret;
227 }
228
229 DataType out_type_ = DT_INT32;
230 };
231 UpperBound(const ::tensorflow::Scope& scope, ::tensorflow::Input sorted_inputs,
232 ::tensorflow::Input values);
233 UpperBound(const ::tensorflow::Scope& scope, ::tensorflow::Input sorted_inputs,
234 ::tensorflow::Input values, const UpperBound::Attrs& attrs);
235 operator ::tensorflow::Output() const { return output; }
236 operator ::tensorflow::Input() const { return output; }
237 ::tensorflow::Node* node() const { return output.node(); }
238
239 static Attrs OutType(DataType x) {
240 return Attrs().OutType(x);
241 }
242
243 Operation operation;
244 ::tensorflow::Output output;
245};
246
247} // namespace internal
248} // namespace ops
249} // namespace tensorflow
250
251#endif // TENSORFLOW_CC_OPS_ARRAY_OPS_INTERNAL_H_
252