1// This file is MACHINE GENERATED! Do not edit.
2
3
4#include "tensorflow/cc/ops/const_op.h"
5#include "tensorflow/cc/ops/lookup_ops.h"
6
7namespace tensorflow {
8namespace ops {
9
10HashTable::HashTable(const ::tensorflow::Scope& scope, DataType key_dtype,
11 DataType value_dtype, const HashTable::Attrs& attrs) {
12 if (!scope.ok()) return;
13 ::tensorflow::Node* ret;
14 const auto unique_name = scope.GetUniqueNameForOp("HashTable");
15 auto builder = ::tensorflow::NodeBuilder(unique_name, "HashTableV2")
16 .Attr("container", attrs.container_)
17 .Attr("shared_name", attrs.shared_name_)
18 .Attr("use_node_name_sharing", attrs.use_node_name_sharing_)
19 .Attr("key_dtype", key_dtype)
20 .Attr("value_dtype", value_dtype)
21 ;
22 scope.UpdateBuilder(&builder);
23 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
24 if (!scope.ok()) return;
25 scope.UpdateStatus(scope.DoShapeInference(ret));
26 this->operation = Operation(ret);
27 this->table_handle = Output(ret, 0);
28}
29
30HashTable::HashTable(const ::tensorflow::Scope& scope, DataType key_dtype,
31 DataType value_dtype)
32 : HashTable(scope, key_dtype, value_dtype, HashTable::Attrs()) {}
33
34InitializeTableFromTextFile::InitializeTableFromTextFile(const
35 ::tensorflow::Scope&
36 scope,
37 ::tensorflow::Input
38 table_handle,
39 ::tensorflow::Input
40 filename, int64
41 key_index, int64
42 value_index, const
43 InitializeTableFromTextFile::Attrs&
44 attrs) {
45 if (!scope.ok()) return;
46 auto _table_handle = ::tensorflow::ops::AsNodeOut(scope, table_handle);
47 if (!scope.ok()) return;
48 auto _filename = ::tensorflow::ops::AsNodeOut(scope, filename);
49 if (!scope.ok()) return;
50 ::tensorflow::Node* ret;
51 const auto unique_name = scope.GetUniqueNameForOp("InitializeTableFromTextFile");
52 auto builder = ::tensorflow::NodeBuilder(unique_name, "InitializeTableFromTextFileV2")
53 .Input(_table_handle)
54 .Input(_filename)
55 .Attr("key_index", key_index)
56 .Attr("value_index", value_index)
57 .Attr("vocab_size", attrs.vocab_size_)
58 .Attr("delimiter", attrs.delimiter_)
59 .Attr("offset", attrs.offset_)
60 ;
61 scope.UpdateBuilder(&builder);
62 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
63 if (!scope.ok()) return;
64 scope.UpdateStatus(scope.DoShapeInference(ret));
65 this->operation = Operation(ret);
66 return;
67}
68
69InitializeTableFromTextFile::InitializeTableFromTextFile(const
70 ::tensorflow::Scope&
71 scope,
72 ::tensorflow::Input
73 table_handle,
74 ::tensorflow::Input
75 filename, int64
76 key_index, int64
77 value_index)
78 : InitializeTableFromTextFile(scope, table_handle, filename, key_index, value_index, InitializeTableFromTextFile::Attrs()) {}
79
80InitializeTable::InitializeTable(const ::tensorflow::Scope& scope,
81 ::tensorflow::Input table_handle,
82 ::tensorflow::Input keys, ::tensorflow::Input
83 values) {
84 if (!scope.ok()) return;
85 auto _table_handle = ::tensorflow::ops::AsNodeOut(scope, table_handle);
86 if (!scope.ok()) return;
87 auto _keys = ::tensorflow::ops::AsNodeOut(scope, keys);
88 if (!scope.ok()) return;
89 auto _values = ::tensorflow::ops::AsNodeOut(scope, values);
90 if (!scope.ok()) return;
91 ::tensorflow::Node* ret;
92 const auto unique_name = scope.GetUniqueNameForOp("InitializeTable");
93 auto builder = ::tensorflow::NodeBuilder(unique_name, "InitializeTableV2")
94 .Input(_table_handle)
95 .Input(_keys)
96 .Input(_values)
97 ;
98 scope.UpdateBuilder(&builder);
99 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
100 if (!scope.ok()) return;
101 scope.UpdateStatus(scope.DoShapeInference(ret));
102 this->operation = Operation(ret);
103 return;
104}
105
106LookupTableExport::LookupTableExport(const ::tensorflow::Scope& scope,
107 ::tensorflow::Input table_handle, DataType
108 Tkeys, DataType Tvalues) {
109 if (!scope.ok()) return;
110 auto _table_handle = ::tensorflow::ops::AsNodeOut(scope, table_handle);
111 if (!scope.ok()) return;
112 ::tensorflow::Node* ret;
113 const auto unique_name = scope.GetUniqueNameForOp("LookupTableExport");
114 auto builder = ::tensorflow::NodeBuilder(unique_name, "LookupTableExportV2")
115 .Input(_table_handle)
116 .Attr("Tkeys", Tkeys)
117 .Attr("Tvalues", Tvalues)
118 ;
119 scope.UpdateBuilder(&builder);
120 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
121 if (!scope.ok()) return;
122 scope.UpdateStatus(scope.DoShapeInference(ret));
123 this->operation = Operation(ret);
124 ::tensorflow::NameRangeMap _outputs_range;
125 ::tensorflow::Status _status_ = ::tensorflow::NameRangesForNode(*ret, ret->op_def(), nullptr, &_outputs_range);
126 if (!_status_.ok()) {
127 scope.UpdateStatus(_status_);
128 return;
129 }
130
131 this->keys = Output(ret, _outputs_range["keys"].first);
132 this->values = Output(ret, _outputs_range["values"].first);
133}
134
135LookupTableFind::LookupTableFind(const ::tensorflow::Scope& scope,
136 ::tensorflow::Input table_handle,
137 ::tensorflow::Input keys, ::tensorflow::Input
138 default_value) {
139 if (!scope.ok()) return;
140 auto _table_handle = ::tensorflow::ops::AsNodeOut(scope, table_handle);
141 if (!scope.ok()) return;
142 auto _keys = ::tensorflow::ops::AsNodeOut(scope, keys);
143 if (!scope.ok()) return;
144 auto _default_value = ::tensorflow::ops::AsNodeOut(scope, default_value);
145 if (!scope.ok()) return;
146 ::tensorflow::Node* ret;
147 const auto unique_name = scope.GetUniqueNameForOp("LookupTableFind");
148 auto builder = ::tensorflow::NodeBuilder(unique_name, "LookupTableFindV2")
149 .Input(_table_handle)
150 .Input(_keys)
151 .Input(_default_value)
152 ;
153 scope.UpdateBuilder(&builder);
154 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
155 if (!scope.ok()) return;
156 scope.UpdateStatus(scope.DoShapeInference(ret));
157 this->operation = Operation(ret);
158 this->values = Output(ret, 0);
159}
160
161LookupTableImport::LookupTableImport(const ::tensorflow::Scope& scope,
162 ::tensorflow::Input table_handle,
163 ::tensorflow::Input keys,
164 ::tensorflow::Input values) {
165 if (!scope.ok()) return;
166 auto _table_handle = ::tensorflow::ops::AsNodeOut(scope, table_handle);
167 if (!scope.ok()) return;
168 auto _keys = ::tensorflow::ops::AsNodeOut(scope, keys);
169 if (!scope.ok()) return;
170 auto _values = ::tensorflow::ops::AsNodeOut(scope, values);
171 if (!scope.ok()) return;
172 ::tensorflow::Node* ret;
173 const auto unique_name = scope.GetUniqueNameForOp("LookupTableImport");
174 auto builder = ::tensorflow::NodeBuilder(unique_name, "LookupTableImportV2")
175 .Input(_table_handle)
176 .Input(_keys)
177 .Input(_values)
178 ;
179 scope.UpdateBuilder(&builder);
180 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
181 if (!scope.ok()) return;
182 scope.UpdateStatus(scope.DoShapeInference(ret));
183 this->operation = Operation(ret);
184 return;
185}
186
187LookupTableInsert::LookupTableInsert(const ::tensorflow::Scope& scope,
188 ::tensorflow::Input table_handle,
189 ::tensorflow::Input keys,
190 ::tensorflow::Input values) {
191 if (!scope.ok()) return;
192 auto _table_handle = ::tensorflow::ops::AsNodeOut(scope, table_handle);
193 if (!scope.ok()) return;
194 auto _keys = ::tensorflow::ops::AsNodeOut(scope, keys);
195 if (!scope.ok()) return;
196 auto _values = ::tensorflow::ops::AsNodeOut(scope, values);
197 if (!scope.ok()) return;
198 ::tensorflow::Node* ret;
199 const auto unique_name = scope.GetUniqueNameForOp("LookupTableInsert");
200 auto builder = ::tensorflow::NodeBuilder(unique_name, "LookupTableInsertV2")
201 .Input(_table_handle)
202 .Input(_keys)
203 .Input(_values)
204 ;
205 scope.UpdateBuilder(&builder);
206 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
207 if (!scope.ok()) return;
208 scope.UpdateStatus(scope.DoShapeInference(ret));
209 this->operation = Operation(ret);
210 return;
211}
212
213LookupTableSize::LookupTableSize(const ::tensorflow::Scope& scope,
214 ::tensorflow::Input table_handle) {
215 if (!scope.ok()) return;
216 auto _table_handle = ::tensorflow::ops::AsNodeOut(scope, table_handle);
217 if (!scope.ok()) return;
218 ::tensorflow::Node* ret;
219 const auto unique_name = scope.GetUniqueNameForOp("LookupTableSize");
220 auto builder = ::tensorflow::NodeBuilder(unique_name, "LookupTableSizeV2")
221 .Input(_table_handle)
222 ;
223 scope.UpdateBuilder(&builder);
224 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
225 if (!scope.ok()) return;
226 scope.UpdateStatus(scope.DoShapeInference(ret));
227 this->operation = Operation(ret);
228 this->size = Output(ret, 0);
229}
230
231MutableDenseHashTable::MutableDenseHashTable(const ::tensorflow::Scope& scope,
232 ::tensorflow::Input empty_key,
233 ::tensorflow::Input deleted_key,
234 DataType value_dtype, const
235 MutableDenseHashTable::Attrs&
236 attrs) {
237 if (!scope.ok()) return;
238 auto _empty_key = ::tensorflow::ops::AsNodeOut(scope, empty_key);
239 if (!scope.ok()) return;
240 auto _deleted_key = ::tensorflow::ops::AsNodeOut(scope, deleted_key);
241 if (!scope.ok()) return;
242 ::tensorflow::Node* ret;
243 const auto unique_name = scope.GetUniqueNameForOp("MutableDenseHashTable");
244 auto builder = ::tensorflow::NodeBuilder(unique_name, "MutableDenseHashTableV2")
245 .Input(_empty_key)
246 .Input(_deleted_key)
247 .Attr("container", attrs.container_)
248 .Attr("shared_name", attrs.shared_name_)
249 .Attr("use_node_name_sharing", attrs.use_node_name_sharing_)
250 .Attr("value_dtype", value_dtype)
251 .Attr("value_shape", attrs.value_shape_)
252 .Attr("initial_num_buckets", attrs.initial_num_buckets_)
253 .Attr("max_load_factor", attrs.max_load_factor_)
254 ;
255 scope.UpdateBuilder(&builder);
256 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
257 if (!scope.ok()) return;
258 scope.UpdateStatus(scope.DoShapeInference(ret));
259 this->operation = Operation(ret);
260 this->table_handle = Output(ret, 0);
261}
262
263MutableDenseHashTable::MutableDenseHashTable(const ::tensorflow::Scope& scope,
264 ::tensorflow::Input empty_key,
265 ::tensorflow::Input deleted_key,
266 DataType value_dtype)
267 : MutableDenseHashTable(scope, empty_key, deleted_key, value_dtype, MutableDenseHashTable::Attrs()) {}
268
269MutableHashTableOfTensors::MutableHashTableOfTensors(const ::tensorflow::Scope&
270 scope, DataType key_dtype,
271 DataType value_dtype,
272 const
273 MutableHashTableOfTensors::Attrs&
274 attrs) {
275 if (!scope.ok()) return;
276 ::tensorflow::Node* ret;
277 const auto unique_name = scope.GetUniqueNameForOp("MutableHashTableOfTensors");
278 auto builder = ::tensorflow::NodeBuilder(unique_name, "MutableHashTableOfTensorsV2")
279 .Attr("container", attrs.container_)
280 .Attr("shared_name", attrs.shared_name_)
281 .Attr("use_node_name_sharing", attrs.use_node_name_sharing_)
282 .Attr("key_dtype", key_dtype)
283 .Attr("value_dtype", value_dtype)
284 .Attr("value_shape", attrs.value_shape_)
285 ;
286 scope.UpdateBuilder(&builder);
287 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
288 if (!scope.ok()) return;
289 scope.UpdateStatus(scope.DoShapeInference(ret));
290 this->operation = Operation(ret);
291 this->table_handle = Output(ret, 0);
292}
293
294MutableHashTableOfTensors::MutableHashTableOfTensors(const ::tensorflow::Scope&
295 scope, DataType key_dtype,
296 DataType value_dtype)
297 : MutableHashTableOfTensors(scope, key_dtype, value_dtype, MutableHashTableOfTensors::Attrs()) {}
298
299MutableHashTable::MutableHashTable(const ::tensorflow::Scope& scope, DataType
300 key_dtype, DataType value_dtype, const
301 MutableHashTable::Attrs& attrs) {
302 if (!scope.ok()) return;
303 ::tensorflow::Node* ret;
304 const auto unique_name = scope.GetUniqueNameForOp("MutableHashTable");
305 auto builder = ::tensorflow::NodeBuilder(unique_name, "MutableHashTableV2")
306 .Attr("container", attrs.container_)
307 .Attr("shared_name", attrs.shared_name_)
308 .Attr("use_node_name_sharing", attrs.use_node_name_sharing_)
309 .Attr("key_dtype", key_dtype)
310 .Attr("value_dtype", value_dtype)
311 ;
312 scope.UpdateBuilder(&builder);
313 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
314 if (!scope.ok()) return;
315 scope.UpdateStatus(scope.DoShapeInference(ret));
316 this->operation = Operation(ret);
317 this->table_handle = Output(ret, 0);
318}
319
320MutableHashTable::MutableHashTable(const ::tensorflow::Scope& scope, DataType
321 key_dtype, DataType value_dtype)
322 : MutableHashTable(scope, key_dtype, value_dtype, MutableHashTable::Attrs()) {}
323
324/// @}
325
326} // namespace ops
327} // namespace tensorflow
328