1// This file is MACHINE GENERATED! Do not edit.
2
3
4#include "tensorflow/cc/ops/const_op.h"
5#include "tensorflow/cc/ops/io_ops.h"
6
7namespace tensorflow {
8namespace ops {
9
10FixedLengthRecordReader::FixedLengthRecordReader(const ::tensorflow::Scope&
11 scope, int64 record_bytes,
12 const
13 FixedLengthRecordReader::Attrs&
14 attrs) {
15 if (!scope.ok()) return;
16 ::tensorflow::Node* ret;
17 const auto unique_name = scope.GetUniqueNameForOp("FixedLengthRecordReader");
18 auto builder = ::tensorflow::NodeBuilder(unique_name, "FixedLengthRecordReaderV2")
19 .Attr("header_bytes", attrs.header_bytes_)
20 .Attr("record_bytes", record_bytes)
21 .Attr("footer_bytes", attrs.footer_bytes_)
22 .Attr("hop_bytes", attrs.hop_bytes_)
23 .Attr("container", attrs.container_)
24 .Attr("shared_name", attrs.shared_name_)
25 .Attr("encoding", attrs.encoding_)
26 ;
27 scope.UpdateBuilder(&builder);
28 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
29 if (!scope.ok()) return;
30 scope.UpdateStatus(scope.DoShapeInference(ret));
31 this->operation = Operation(ret);
32 this->reader_handle = Output(ret, 0);
33}
34
35FixedLengthRecordReader::FixedLengthRecordReader(const ::tensorflow::Scope&
36 scope, int64 record_bytes)
37 : FixedLengthRecordReader(scope, record_bytes, FixedLengthRecordReader::Attrs()) {}
38
39IdentityReader::IdentityReader(const ::tensorflow::Scope& scope, const
40 IdentityReader::Attrs& attrs) {
41 if (!scope.ok()) return;
42 ::tensorflow::Node* ret;
43 const auto unique_name = scope.GetUniqueNameForOp("IdentityReader");
44 auto builder = ::tensorflow::NodeBuilder(unique_name, "IdentityReaderV2")
45 .Attr("container", attrs.container_)
46 .Attr("shared_name", attrs.shared_name_)
47 ;
48 scope.UpdateBuilder(&builder);
49 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
50 if (!scope.ok()) return;
51 scope.UpdateStatus(scope.DoShapeInference(ret));
52 this->operation = Operation(ret);
53 this->reader_handle = Output(ret, 0);
54}
55
56IdentityReader::IdentityReader(const ::tensorflow::Scope& scope)
57 : IdentityReader(scope, IdentityReader::Attrs()) {}
58
59LMDBReader::LMDBReader(const ::tensorflow::Scope& scope, const
60 LMDBReader::Attrs& attrs) {
61 if (!scope.ok()) return;
62 ::tensorflow::Node* ret;
63 const auto unique_name = scope.GetUniqueNameForOp("LMDBReader");
64 auto builder = ::tensorflow::NodeBuilder(unique_name, "LMDBReader")
65 .Attr("container", attrs.container_)
66 .Attr("shared_name", attrs.shared_name_)
67 ;
68 scope.UpdateBuilder(&builder);
69 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
70 if (!scope.ok()) return;
71 scope.UpdateStatus(scope.DoShapeInference(ret));
72 this->operation = Operation(ret);
73 this->reader_handle = Output(ret, 0);
74}
75
76LMDBReader::LMDBReader(const ::tensorflow::Scope& scope)
77 : LMDBReader(scope, LMDBReader::Attrs()) {}
78
79MatchingFiles::MatchingFiles(const ::tensorflow::Scope& scope,
80 ::tensorflow::Input pattern) {
81 if (!scope.ok()) return;
82 auto _pattern = ::tensorflow::ops::AsNodeOut(scope, pattern);
83 if (!scope.ok()) return;
84 ::tensorflow::Node* ret;
85 const auto unique_name = scope.GetUniqueNameForOp("MatchingFiles");
86 auto builder = ::tensorflow::NodeBuilder(unique_name, "MatchingFiles")
87 .Input(_pattern)
88 ;
89 scope.UpdateBuilder(&builder);
90 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
91 if (!scope.ok()) return;
92 scope.UpdateStatus(scope.DoShapeInference(ret));
93 this->operation = Operation(ret);
94 this->filenames = Output(ret, 0);
95}
96
97MergeV2Checkpoints::MergeV2Checkpoints(const ::tensorflow::Scope& scope,
98 ::tensorflow::Input checkpoint_prefixes,
99 ::tensorflow::Input destination_prefix,
100 const MergeV2Checkpoints::Attrs& attrs) {
101 if (!scope.ok()) return;
102 auto _checkpoint_prefixes = ::tensorflow::ops::AsNodeOut(scope, checkpoint_prefixes);
103 if (!scope.ok()) return;
104 auto _destination_prefix = ::tensorflow::ops::AsNodeOut(scope, destination_prefix);
105 if (!scope.ok()) return;
106 ::tensorflow::Node* ret;
107 const auto unique_name = scope.GetUniqueNameForOp("MergeV2Checkpoints");
108 auto builder = ::tensorflow::NodeBuilder(unique_name, "MergeV2Checkpoints")
109 .Input(_checkpoint_prefixes)
110 .Input(_destination_prefix)
111 .Attr("delete_old_dirs", attrs.delete_old_dirs_)
112 .Attr("allow_missing_files", attrs.allow_missing_files_)
113 ;
114 scope.UpdateBuilder(&builder);
115 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
116 if (!scope.ok()) return;
117 scope.UpdateStatus(scope.DoShapeInference(ret));
118 this->operation = Operation(ret);
119 return;
120}
121
122MergeV2Checkpoints::MergeV2Checkpoints(const ::tensorflow::Scope& scope,
123 ::tensorflow::Input checkpoint_prefixes,
124 ::tensorflow::Input destination_prefix)
125 : MergeV2Checkpoints(scope, checkpoint_prefixes, destination_prefix, MergeV2Checkpoints::Attrs()) {}
126
127ReadFile::ReadFile(const ::tensorflow::Scope& scope, ::tensorflow::Input
128 filename) {
129 if (!scope.ok()) return;
130 auto _filename = ::tensorflow::ops::AsNodeOut(scope, filename);
131 if (!scope.ok()) return;
132 ::tensorflow::Node* ret;
133 const auto unique_name = scope.GetUniqueNameForOp("ReadFile");
134 auto builder = ::tensorflow::NodeBuilder(unique_name, "ReadFile")
135 .Input(_filename)
136 ;
137 scope.UpdateBuilder(&builder);
138 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
139 if (!scope.ok()) return;
140 scope.UpdateStatus(scope.DoShapeInference(ret));
141 this->operation = Operation(ret);
142 this->contents = Output(ret, 0);
143}
144
145ReaderNumRecordsProduced::ReaderNumRecordsProduced(const ::tensorflow::Scope&
146 scope, ::tensorflow::Input
147 reader_handle) {
148 if (!scope.ok()) return;
149 auto _reader_handle = ::tensorflow::ops::AsNodeOut(scope, reader_handle);
150 if (!scope.ok()) return;
151 ::tensorflow::Node* ret;
152 const auto unique_name = scope.GetUniqueNameForOp("ReaderNumRecordsProduced");
153 auto builder = ::tensorflow::NodeBuilder(unique_name, "ReaderNumRecordsProducedV2")
154 .Input(_reader_handle)
155 ;
156 scope.UpdateBuilder(&builder);
157 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
158 if (!scope.ok()) return;
159 scope.UpdateStatus(scope.DoShapeInference(ret));
160 this->operation = Operation(ret);
161 this->records_produced = Output(ret, 0);
162}
163
164ReaderNumWorkUnitsCompleted::ReaderNumWorkUnitsCompleted(const
165 ::tensorflow::Scope&
166 scope,
167 ::tensorflow::Input
168 reader_handle) {
169 if (!scope.ok()) return;
170 auto _reader_handle = ::tensorflow::ops::AsNodeOut(scope, reader_handle);
171 if (!scope.ok()) return;
172 ::tensorflow::Node* ret;
173 const auto unique_name = scope.GetUniqueNameForOp("ReaderNumWorkUnitsCompleted");
174 auto builder = ::tensorflow::NodeBuilder(unique_name, "ReaderNumWorkUnitsCompletedV2")
175 .Input(_reader_handle)
176 ;
177 scope.UpdateBuilder(&builder);
178 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
179 if (!scope.ok()) return;
180 scope.UpdateStatus(scope.DoShapeInference(ret));
181 this->operation = Operation(ret);
182 this->units_completed = Output(ret, 0);
183}
184
185ReaderReadUpTo::ReaderReadUpTo(const ::tensorflow::Scope& scope,
186 ::tensorflow::Input reader_handle,
187 ::tensorflow::Input queue_handle,
188 ::tensorflow::Input num_records) {
189 if (!scope.ok()) return;
190 auto _reader_handle = ::tensorflow::ops::AsNodeOut(scope, reader_handle);
191 if (!scope.ok()) return;
192 auto _queue_handle = ::tensorflow::ops::AsNodeOut(scope, queue_handle);
193 if (!scope.ok()) return;
194 auto _num_records = ::tensorflow::ops::AsNodeOut(scope, num_records);
195 if (!scope.ok()) return;
196 ::tensorflow::Node* ret;
197 const auto unique_name = scope.GetUniqueNameForOp("ReaderReadUpTo");
198 auto builder = ::tensorflow::NodeBuilder(unique_name, "ReaderReadUpToV2")
199 .Input(_reader_handle)
200 .Input(_queue_handle)
201 .Input(_num_records)
202 ;
203 scope.UpdateBuilder(&builder);
204 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
205 if (!scope.ok()) return;
206 scope.UpdateStatus(scope.DoShapeInference(ret));
207 this->operation = Operation(ret);
208 ::tensorflow::NameRangeMap _outputs_range;
209 ::tensorflow::Status _status_ = ::tensorflow::NameRangesForNode(*ret, ret->op_def(), nullptr, &_outputs_range);
210 if (!_status_.ok()) {
211 scope.UpdateStatus(_status_);
212 return;
213 }
214
215 this->keys = Output(ret, _outputs_range["keys"].first);
216 this->values = Output(ret, _outputs_range["values"].first);
217}
218
219ReaderRead::ReaderRead(const ::tensorflow::Scope& scope, ::tensorflow::Input
220 reader_handle, ::tensorflow::Input queue_handle) {
221 if (!scope.ok()) return;
222 auto _reader_handle = ::tensorflow::ops::AsNodeOut(scope, reader_handle);
223 if (!scope.ok()) return;
224 auto _queue_handle = ::tensorflow::ops::AsNodeOut(scope, queue_handle);
225 if (!scope.ok()) return;
226 ::tensorflow::Node* ret;
227 const auto unique_name = scope.GetUniqueNameForOp("ReaderRead");
228 auto builder = ::tensorflow::NodeBuilder(unique_name, "ReaderReadV2")
229 .Input(_reader_handle)
230 .Input(_queue_handle)
231 ;
232 scope.UpdateBuilder(&builder);
233 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
234 if (!scope.ok()) return;
235 scope.UpdateStatus(scope.DoShapeInference(ret));
236 this->operation = Operation(ret);
237 ::tensorflow::NameRangeMap _outputs_range;
238 ::tensorflow::Status _status_ = ::tensorflow::NameRangesForNode(*ret, ret->op_def(), nullptr, &_outputs_range);
239 if (!_status_.ok()) {
240 scope.UpdateStatus(_status_);
241 return;
242 }
243
244 this->key = Output(ret, _outputs_range["key"].first);
245 this->value = Output(ret, _outputs_range["value"].first);
246}
247
248ReaderReset::ReaderReset(const ::tensorflow::Scope& scope, ::tensorflow::Input
249 reader_handle) {
250 if (!scope.ok()) return;
251 auto _reader_handle = ::tensorflow::ops::AsNodeOut(scope, reader_handle);
252 if (!scope.ok()) return;
253 ::tensorflow::Node* ret;
254 const auto unique_name = scope.GetUniqueNameForOp("ReaderReset");
255 auto builder = ::tensorflow::NodeBuilder(unique_name, "ReaderResetV2")
256 .Input(_reader_handle)
257 ;
258 scope.UpdateBuilder(&builder);
259 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
260 if (!scope.ok()) return;
261 scope.UpdateStatus(scope.DoShapeInference(ret));
262 this->operation = Operation(ret);
263 return;
264}
265
266ReaderRestoreState::ReaderRestoreState(const ::tensorflow::Scope& scope,
267 ::tensorflow::Input reader_handle,
268 ::tensorflow::Input state) {
269 if (!scope.ok()) return;
270 auto _reader_handle = ::tensorflow::ops::AsNodeOut(scope, reader_handle);
271 if (!scope.ok()) return;
272 auto _state = ::tensorflow::ops::AsNodeOut(scope, state);
273 if (!scope.ok()) return;
274 ::tensorflow::Node* ret;
275 const auto unique_name = scope.GetUniqueNameForOp("ReaderRestoreState");
276 auto builder = ::tensorflow::NodeBuilder(unique_name, "ReaderRestoreStateV2")
277 .Input(_reader_handle)
278 .Input(_state)
279 ;
280 scope.UpdateBuilder(&builder);
281 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
282 if (!scope.ok()) return;
283 scope.UpdateStatus(scope.DoShapeInference(ret));
284 this->operation = Operation(ret);
285 return;
286}
287
288ReaderSerializeState::ReaderSerializeState(const ::tensorflow::Scope& scope,
289 ::tensorflow::Input reader_handle) {
290 if (!scope.ok()) return;
291 auto _reader_handle = ::tensorflow::ops::AsNodeOut(scope, reader_handle);
292 if (!scope.ok()) return;
293 ::tensorflow::Node* ret;
294 const auto unique_name = scope.GetUniqueNameForOp("ReaderSerializeState");
295 auto builder = ::tensorflow::NodeBuilder(unique_name, "ReaderSerializeStateV2")
296 .Input(_reader_handle)
297 ;
298 scope.UpdateBuilder(&builder);
299 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
300 if (!scope.ok()) return;
301 scope.UpdateStatus(scope.DoShapeInference(ret));
302 this->operation = Operation(ret);
303 this->state = Output(ret, 0);
304}
305
306Restore::Restore(const ::tensorflow::Scope& scope, ::tensorflow::Input
307 file_pattern, ::tensorflow::Input tensor_name, DataType dt,
308 const Restore::Attrs& attrs) {
309 if (!scope.ok()) return;
310 auto _file_pattern = ::tensorflow::ops::AsNodeOut(scope, file_pattern);
311 if (!scope.ok()) return;
312 auto _tensor_name = ::tensorflow::ops::AsNodeOut(scope, tensor_name);
313 if (!scope.ok()) return;
314 ::tensorflow::Node* ret;
315 const auto unique_name = scope.GetUniqueNameForOp("Restore");
316 auto builder = ::tensorflow::NodeBuilder(unique_name, "Restore")
317 .Input(_file_pattern)
318 .Input(_tensor_name)
319 .Attr("dt", dt)
320 .Attr("preferred_shard", attrs.preferred_shard_)
321 ;
322 scope.UpdateBuilder(&builder);
323 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
324 if (!scope.ok()) return;
325 scope.UpdateStatus(scope.DoShapeInference(ret));
326 this->operation = Operation(ret);
327 this->tensor = Output(ret, 0);
328}
329
330Restore::Restore(const ::tensorflow::Scope& scope, ::tensorflow::Input
331 file_pattern, ::tensorflow::Input tensor_name, DataType dt)
332 : Restore(scope, file_pattern, tensor_name, dt, Restore::Attrs()) {}
333
334RestoreSlice::RestoreSlice(const ::tensorflow::Scope& scope,
335 ::tensorflow::Input file_pattern,
336 ::tensorflow::Input tensor_name, ::tensorflow::Input
337 shape_and_slice, DataType dt, const
338 RestoreSlice::Attrs& attrs) {
339 if (!scope.ok()) return;
340 auto _file_pattern = ::tensorflow::ops::AsNodeOut(scope, file_pattern);
341 if (!scope.ok()) return;
342 auto _tensor_name = ::tensorflow::ops::AsNodeOut(scope, tensor_name);
343 if (!scope.ok()) return;
344 auto _shape_and_slice = ::tensorflow::ops::AsNodeOut(scope, shape_and_slice);
345 if (!scope.ok()) return;
346 ::tensorflow::Node* ret;
347 const auto unique_name = scope.GetUniqueNameForOp("RestoreSlice");
348 auto builder = ::tensorflow::NodeBuilder(unique_name, "RestoreSlice")
349 .Input(_file_pattern)
350 .Input(_tensor_name)
351 .Input(_shape_and_slice)
352 .Attr("dt", dt)
353 .Attr("preferred_shard", attrs.preferred_shard_)
354 ;
355 scope.UpdateBuilder(&builder);
356 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
357 if (!scope.ok()) return;
358 scope.UpdateStatus(scope.DoShapeInference(ret));
359 this->operation = Operation(ret);
360 this->tensor = Output(ret, 0);
361}
362
363RestoreSlice::RestoreSlice(const ::tensorflow::Scope& scope,
364 ::tensorflow::Input file_pattern,
365 ::tensorflow::Input tensor_name, ::tensorflow::Input
366 shape_and_slice, DataType dt)
367 : RestoreSlice(scope, file_pattern, tensor_name, shape_and_slice, dt, RestoreSlice::Attrs()) {}
368
369RestoreV2::RestoreV2(const ::tensorflow::Scope& scope, ::tensorflow::Input
370 prefix, ::tensorflow::Input tensor_names,
371 ::tensorflow::Input shape_and_slices, const DataTypeSlice&
372 dtypes) {
373 if (!scope.ok()) return;
374 auto _prefix = ::tensorflow::ops::AsNodeOut(scope, prefix);
375 if (!scope.ok()) return;
376 auto _tensor_names = ::tensorflow::ops::AsNodeOut(scope, tensor_names);
377 if (!scope.ok()) return;
378 auto _shape_and_slices = ::tensorflow::ops::AsNodeOut(scope, shape_and_slices);
379 if (!scope.ok()) return;
380 ::tensorflow::Node* ret;
381 const auto unique_name = scope.GetUniqueNameForOp("RestoreV2");
382 auto builder = ::tensorflow::NodeBuilder(unique_name, "RestoreV2")
383 .Input(_prefix)
384 .Input(_tensor_names)
385 .Input(_shape_and_slices)
386 .Attr("dtypes", dtypes)
387 ;
388 scope.UpdateBuilder(&builder);
389 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
390 if (!scope.ok()) return;
391 scope.UpdateStatus(scope.DoShapeInference(ret));
392 this->operation = Operation(ret);
393 for (int32 i = 0; i < ret->num_outputs(); ++i)
394 this->tensors.push_back(Output(ret, i));
395}
396
397Save::Save(const ::tensorflow::Scope& scope, ::tensorflow::Input filename,
398 ::tensorflow::Input tensor_names, ::tensorflow::InputList data) {
399 if (!scope.ok()) return;
400 auto _filename = ::tensorflow::ops::AsNodeOut(scope, filename);
401 if (!scope.ok()) return;
402 auto _tensor_names = ::tensorflow::ops::AsNodeOut(scope, tensor_names);
403 if (!scope.ok()) return;
404 auto _data = ::tensorflow::ops::AsNodeOutList(scope, data);
405 if (!scope.ok()) return;
406 ::tensorflow::Node* ret;
407 const auto unique_name = scope.GetUniqueNameForOp("Save");
408 auto builder = ::tensorflow::NodeBuilder(unique_name, "Save")
409 .Input(_filename)
410 .Input(_tensor_names)
411 .Input(_data)
412 ;
413 scope.UpdateBuilder(&builder);
414 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
415 if (!scope.ok()) return;
416 scope.UpdateStatus(scope.DoShapeInference(ret));
417 this->operation = Operation(ret);
418 return;
419}
420
421SaveSlices::SaveSlices(const ::tensorflow::Scope& scope, ::tensorflow::Input
422 filename, ::tensorflow::Input tensor_names,
423 ::tensorflow::Input shapes_and_slices,
424 ::tensorflow::InputList data) {
425 if (!scope.ok()) return;
426 auto _filename = ::tensorflow::ops::AsNodeOut(scope, filename);
427 if (!scope.ok()) return;
428 auto _tensor_names = ::tensorflow::ops::AsNodeOut(scope, tensor_names);
429 if (!scope.ok()) return;
430 auto _shapes_and_slices = ::tensorflow::ops::AsNodeOut(scope, shapes_and_slices);
431 if (!scope.ok()) return;
432 auto _data = ::tensorflow::ops::AsNodeOutList(scope, data);
433 if (!scope.ok()) return;
434 ::tensorflow::Node* ret;
435 const auto unique_name = scope.GetUniqueNameForOp("SaveSlices");
436 auto builder = ::tensorflow::NodeBuilder(unique_name, "SaveSlices")
437 .Input(_filename)
438 .Input(_tensor_names)
439 .Input(_shapes_and_slices)
440 .Input(_data)
441 ;
442 scope.UpdateBuilder(&builder);
443 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
444 if (!scope.ok()) return;
445 scope.UpdateStatus(scope.DoShapeInference(ret));
446 this->operation = Operation(ret);
447 return;
448}
449
450SaveV2::SaveV2(const ::tensorflow::Scope& scope, ::tensorflow::Input prefix,
451 ::tensorflow::Input tensor_names, ::tensorflow::Input
452 shape_and_slices, ::tensorflow::InputList tensors) {
453 if (!scope.ok()) return;
454 auto _prefix = ::tensorflow::ops::AsNodeOut(scope, prefix);
455 if (!scope.ok()) return;
456 auto _tensor_names = ::tensorflow::ops::AsNodeOut(scope, tensor_names);
457 if (!scope.ok()) return;
458 auto _shape_and_slices = ::tensorflow::ops::AsNodeOut(scope, shape_and_slices);
459 if (!scope.ok()) return;
460 auto _tensors = ::tensorflow::ops::AsNodeOutList(scope, tensors);
461 if (!scope.ok()) return;
462 ::tensorflow::Node* ret;
463 const auto unique_name = scope.GetUniqueNameForOp("SaveV2");
464 auto builder = ::tensorflow::NodeBuilder(unique_name, "SaveV2")
465 .Input(_prefix)
466 .Input(_tensor_names)
467 .Input(_shape_and_slices)
468 .Input(_tensors)
469 ;
470 scope.UpdateBuilder(&builder);
471 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
472 if (!scope.ok()) return;
473 scope.UpdateStatus(scope.DoShapeInference(ret));
474 this->operation = Operation(ret);
475 return;
476}
477
478ShardedFilename::ShardedFilename(const ::tensorflow::Scope& scope,
479 ::tensorflow::Input basename,
480 ::tensorflow::Input shard, ::tensorflow::Input
481 num_shards) {
482 if (!scope.ok()) return;
483 auto _basename = ::tensorflow::ops::AsNodeOut(scope, basename);
484 if (!scope.ok()) return;
485 auto _shard = ::tensorflow::ops::AsNodeOut(scope, shard);
486 if (!scope.ok()) return;
487 auto _num_shards = ::tensorflow::ops::AsNodeOut(scope, num_shards);
488 if (!scope.ok()) return;
489 ::tensorflow::Node* ret;
490 const auto unique_name = scope.GetUniqueNameForOp("ShardedFilename");
491 auto builder = ::tensorflow::NodeBuilder(unique_name, "ShardedFilename")
492 .Input(_basename)
493 .Input(_shard)
494 .Input(_num_shards)
495 ;
496 scope.UpdateBuilder(&builder);
497 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
498 if (!scope.ok()) return;
499 scope.UpdateStatus(scope.DoShapeInference(ret));
500 this->operation = Operation(ret);
501 this->filename = Output(ret, 0);
502}
503
504ShardedFilespec::ShardedFilespec(const ::tensorflow::Scope& scope,
505 ::tensorflow::Input basename,
506 ::tensorflow::Input num_shards) {
507 if (!scope.ok()) return;
508 auto _basename = ::tensorflow::ops::AsNodeOut(scope, basename);
509 if (!scope.ok()) return;
510 auto _num_shards = ::tensorflow::ops::AsNodeOut(scope, num_shards);
511 if (!scope.ok()) return;
512 ::tensorflow::Node* ret;
513 const auto unique_name = scope.GetUniqueNameForOp("ShardedFilespec");
514 auto builder = ::tensorflow::NodeBuilder(unique_name, "ShardedFilespec")
515 .Input(_basename)
516 .Input(_num_shards)
517 ;
518 scope.UpdateBuilder(&builder);
519 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
520 if (!scope.ok()) return;
521 scope.UpdateStatus(scope.DoShapeInference(ret));
522 this->operation = Operation(ret);
523 this->filename = Output(ret, 0);
524}
525
526TFRecordReader::TFRecordReader(const ::tensorflow::Scope& scope, const
527 TFRecordReader::Attrs& attrs) {
528 if (!scope.ok()) return;
529 ::tensorflow::Node* ret;
530 const auto unique_name = scope.GetUniqueNameForOp("TFRecordReader");
531 auto builder = ::tensorflow::NodeBuilder(unique_name, "TFRecordReaderV2")
532 .Attr("container", attrs.container_)
533 .Attr("shared_name", attrs.shared_name_)
534 .Attr("compression_type", attrs.compression_type_)
535 ;
536 scope.UpdateBuilder(&builder);
537 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
538 if (!scope.ok()) return;
539 scope.UpdateStatus(scope.DoShapeInference(ret));
540 this->operation = Operation(ret);
541 this->reader_handle = Output(ret, 0);
542}
543
544TFRecordReader::TFRecordReader(const ::tensorflow::Scope& scope)
545 : TFRecordReader(scope, TFRecordReader::Attrs()) {}
546
547TextLineReader::TextLineReader(const ::tensorflow::Scope& scope, const
548 TextLineReader::Attrs& attrs) {
549 if (!scope.ok()) return;
550 ::tensorflow::Node* ret;
551 const auto unique_name = scope.GetUniqueNameForOp("TextLineReader");
552 auto builder = ::tensorflow::NodeBuilder(unique_name, "TextLineReaderV2")
553 .Attr("skip_header_lines", attrs.skip_header_lines_)
554 .Attr("container", attrs.container_)
555 .Attr("shared_name", attrs.shared_name_)
556 ;
557 scope.UpdateBuilder(&builder);
558 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
559 if (!scope.ok()) return;
560 scope.UpdateStatus(scope.DoShapeInference(ret));
561 this->operation = Operation(ret);
562 this->reader_handle = Output(ret, 0);
563}
564
565TextLineReader::TextLineReader(const ::tensorflow::Scope& scope)
566 : TextLineReader(scope, TextLineReader::Attrs()) {}
567
568WholeFileReader::WholeFileReader(const ::tensorflow::Scope& scope, const
569 WholeFileReader::Attrs& attrs) {
570 if (!scope.ok()) return;
571 ::tensorflow::Node* ret;
572 const auto unique_name = scope.GetUniqueNameForOp("WholeFileReader");
573 auto builder = ::tensorflow::NodeBuilder(unique_name, "WholeFileReaderV2")
574 .Attr("container", attrs.container_)
575 .Attr("shared_name", attrs.shared_name_)
576 ;
577 scope.UpdateBuilder(&builder);
578 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
579 if (!scope.ok()) return;
580 scope.UpdateStatus(scope.DoShapeInference(ret));
581 this->operation = Operation(ret);
582 this->reader_handle = Output(ret, 0);
583}
584
585WholeFileReader::WholeFileReader(const ::tensorflow::Scope& scope)
586 : WholeFileReader(scope, WholeFileReader::Attrs()) {}
587
588WriteFile::WriteFile(const ::tensorflow::Scope& scope, ::tensorflow::Input
589 filename, ::tensorflow::Input contents) {
590 if (!scope.ok()) return;
591 auto _filename = ::tensorflow::ops::AsNodeOut(scope, filename);
592 if (!scope.ok()) return;
593 auto _contents = ::tensorflow::ops::AsNodeOut(scope, contents);
594 if (!scope.ok()) return;
595 ::tensorflow::Node* ret;
596 const auto unique_name = scope.GetUniqueNameForOp("WriteFile");
597 auto builder = ::tensorflow::NodeBuilder(unique_name, "WriteFile")
598 .Input(_filename)
599 .Input(_contents)
600 ;
601 scope.UpdateBuilder(&builder);
602 scope.UpdateStatus(builder.Finalize(scope.graph(), &ret));
603 if (!scope.ok()) return;
604 scope.UpdateStatus(scope.DoShapeInference(ret));
605 this->operation = Operation(ret);
606 return;
607}
608
609/// @}
610
611} // namespace ops
612} // namespace tensorflow
613