forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataService.cs
More file actions
1041 lines (946 loc) · 40 KB
/
DataService.cs
File metadata and controls
1041 lines (946 loc) · 40 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/data_service.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021, 8981
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tensorflow.Data {
/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/data_service.proto</summary>
public static partial class DataServiceReflection {
#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/data_service.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static DataServiceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cit0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvZGF0YV9zZXJ2aWNlLnByb3Rv",
"Eg90ZW5zb3JmbG93LmRhdGEitwEKEVByb2Nlc3NpbmdNb2RlRGVmEkoKD3No",
"YXJkaW5nX3BvbGljeRgBIAEoDjIxLnRlbnNvcmZsb3cuZGF0YS5Qcm9jZXNz",
"aW5nTW9kZURlZi5TaGFyZGluZ1BvbGljeSJWCg5TaGFyZGluZ1BvbGljeRIH",
"CgNPRkYQABILCgdEWU5BTUlDEAESCAoERklMRRACEggKBERBVEEQAxIQCgxG",
"SUxFX09SX0RBVEEQBBIICgRISU5UEAUi+wEKE0RhdGFTZXJ2aWNlTWV0YWRh",
"dGESFgoMZWxlbWVudF9zcGVjGAEgASgMSAASRQoLY29tcHJlc3Npb24YAiAB",
"KA4yMC50ZW5zb3JmbG93LmRhdGEuRGF0YVNlcnZpY2VNZXRhZGF0YS5Db21w",
"cmVzc2lvbhITCgtjYXJkaW5hbGl0eRgDIAEoAyJXCgtDb21wcmVzc2lvbhIb",
"ChdDT01QUkVTU0lPTl9VTlNQRUNJRklFRBAAEhMKD0NPTVBSRVNTSU9OX09G",
"RhABEhYKEkNPTVBSRVNTSU9OX1NOQVBQWRACQhcKFW9wdGlvbmFsX2VsZW1l",
"bnRfc3BlYyIuChhDcm9zc1RyYWluZXJDYWNoZU9wdGlvbnMSEgoKdHJhaW5l",
"cl9pZBgBIAEoCSJNChFEYXRhU2VydmljZUNvbmZpZxI4Cg9kZXBsb3ltZW50",
"X21vZGUYASABKA4yHy50ZW5zb3JmbG93LmRhdGEuRGVwbG95bWVudE1vZGUq",
"iAEKDkRlcGxveW1lbnRNb2RlEh8KG0RFUExPWU1FTlRfTU9ERV9VTlNQRUNJ",
"RklFRBAAEh0KGURFUExPWU1FTlRfTU9ERV9DT0xPQ0FURUQQARIaChZERVBM",
"T1lNRU5UX01PREVfUkVNT1RFEAISGgoWREVQTE9ZTUVOVF9NT0RFX0hZQlJJ",
"RBADQldaVWdpdGh1Yi5jb20vdGVuc29yZmxvdy90ZW5zb3JmbG93L3RlbnNv",
"cmZsb3cvZ28vY29yZS9wcm90b2J1Zi9mb3JfY29yZV9wcm90b3NfZ29fcHJv",
"dG9iBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tensorflow.Data.DeploymentMode), }, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Data.ProcessingModeDef), global::Tensorflow.Data.ProcessingModeDef.Parser, new[]{ "ShardingPolicy" }, null, new[]{ typeof(global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy) }, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Data.DataServiceMetadata), global::Tensorflow.Data.DataServiceMetadata.Parser, new[]{ "ElementSpec", "Compression", "Cardinality" }, new[]{ "OptionalElementSpec" }, new[]{ typeof(global::Tensorflow.Data.DataServiceMetadata.Types.Compression) }, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Data.CrossTrainerCacheOptions), global::Tensorflow.Data.CrossTrainerCacheOptions.Parser, new[]{ "TrainerId" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Data.DataServiceConfig), global::Tensorflow.Data.DataServiceConfig.Parser, new[]{ "DeploymentMode" }, null, null, null, null)
}));
}
#endregion
}
#region Enums
/// <summary>
/// tf.data service deployment mode.
/// </summary>
public enum DeploymentMode {
[pbr::OriginalName("DEPLOYMENT_MODE_UNSPECIFIED")] Unspecified = 0,
/// <summary>
/// tf.data service workers colocate with TF workers.
/// </summary>
[pbr::OriginalName("DEPLOYMENT_MODE_COLOCATED")] Colocated = 1,
/// <summary>
/// tf.data service workers run in dedicated tf.data hosts.
/// </summary>
[pbr::OriginalName("DEPLOYMENT_MODE_REMOTE")] Remote = 2,
/// <summary>
/// tf.data service workers run in colocated TF hosts and dedicated tf.data
/// hosts.
/// </summary>
[pbr::OriginalName("DEPLOYMENT_MODE_HYBRID")] Hybrid = 3,
}
#endregion
#region Messages
/// <summary>
/// Next tag: 2
/// </summary>
public sealed partial class ProcessingModeDef : pb::IMessage<ProcessingModeDef>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<ProcessingModeDef> _parser = new pb::MessageParser<ProcessingModeDef>(() => new ProcessingModeDef());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<ProcessingModeDef> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Data.DataServiceReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public ProcessingModeDef() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public ProcessingModeDef(ProcessingModeDef other) : this() {
shardingPolicy_ = other.shardingPolicy_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public ProcessingModeDef Clone() {
return new ProcessingModeDef(this);
}
/// <summary>Field number for the "sharding_policy" field.</summary>
public const int ShardingPolicyFieldNumber = 1;
private global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy shardingPolicy_ = global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy.Off;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy ShardingPolicy {
get { return shardingPolicy_; }
set {
shardingPolicy_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as ProcessingModeDef);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(ProcessingModeDef other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ShardingPolicy != other.ShardingPolicy) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (ShardingPolicy != global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy.Off) hash ^= ShardingPolicy.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (ShardingPolicy != global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy.Off) {
output.WriteRawTag(8);
output.WriteEnum((int) ShardingPolicy);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (ShardingPolicy != global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy.Off) {
output.WriteRawTag(8);
output.WriteEnum((int) ShardingPolicy);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (ShardingPolicy != global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy.Off) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ShardingPolicy);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(ProcessingModeDef other) {
if (other == null) {
return;
}
if (other.ShardingPolicy != global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy.Off) {
ShardingPolicy = other.ShardingPolicy;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
ShardingPolicy = (global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy) input.ReadEnum();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
ShardingPolicy = (global::Tensorflow.Data.ProcessingModeDef.Types.ShardingPolicy) input.ReadEnum();
break;
}
}
}
}
#endif
#region Nested types
/// <summary>Container for nested types declared in the ProcessingModeDef message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static partial class Types {
/// <summary>
/// Specifies how data is sharded among tf.data service workers.
/// </summary>
public enum ShardingPolicy {
/// <summary>
/// No sharding will be performed. Each worker produces the entire dataset
/// without any sharding. With this mode, the best practice is to shuffle the
/// dataset nondeterministically so that workers process the dataset in
/// different orders.
/// </summary>
[pbr::OriginalName("OFF")] Off = 0,
/// <summary>
/// The input dataset is dynamically split among workers at runtime. Each
/// worker gets the next split when it reads data from the dispatcher. There
/// is no fixed sharding with this mode.
/// </summary>
[pbr::OriginalName("DYNAMIC")] Dynamic = 1,
/// <summary>
/// The following are static sharding policies. The semantics are similar to
/// `tf.data.experimental.AutoShardPolicy`. These policies require:
/// * The tf.data service cluster has a fixed size, and you need to specify
/// the workers in DispatcherConfig.
/// * Each client only reads from the local tf.data service worker.
///
/// Shards by input files (each worker will get a set of files to process).
/// When this option is selected, make sure that there is at least as many
/// files as workers. If there are fewer input files than workers, a runtime
/// error will be raised.
/// </summary>
[pbr::OriginalName("FILE")] File = 2,
/// <summary>
/// Shards by elements produced by the dataset. Each worker will process the
/// whole dataset and discard the portion that is not for itself. Note that
/// for this mode to correctly partitions the dataset elements, the dataset
/// needs to produce elements in a deterministic order.
/// </summary>
[pbr::OriginalName("DATA")] Data = 3,
/// <summary>
/// Attempts FILE-based sharding, falling back to DATA-based sharding on
/// failures.
/// </summary>
[pbr::OriginalName("FILE_OR_DATA")] FileOrData = 4,
/// <summary>
/// Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a
/// placeholder to replace with `shard(num_workers, worker_index)`.
/// </summary>
[pbr::OriginalName("HINT")] Hint = 5,
}
}
#endregion
}
/// <summary>
/// Metadata related to tf.data service datasets.
/// Next tag: 4
/// </summary>
public sealed partial class DataServiceMetadata : pb::IMessage<DataServiceMetadata>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<DataServiceMetadata> _parser = new pb::MessageParser<DataServiceMetadata>(() => new DataServiceMetadata());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<DataServiceMetadata> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Data.DataServiceReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public DataServiceMetadata() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public DataServiceMetadata(DataServiceMetadata other) : this() {
compression_ = other.compression_;
cardinality_ = other.cardinality_;
switch (other.OptionalElementSpecCase) {
case OptionalElementSpecOneofCase.ElementSpec:
ElementSpec = other.ElementSpec;
break;
}
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public DataServiceMetadata Clone() {
return new DataServiceMetadata(this);
}
/// <summary>Field number for the "element_spec" field.</summary>
public const int ElementSpecFieldNumber = 1;
/// <summary>
/// Serialized element spec.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pb::ByteString ElementSpec {
get { return optionalElementSpecCase_ == OptionalElementSpecOneofCase.ElementSpec ? (pb::ByteString) optionalElementSpec_ : pb::ByteString.Empty; }
set {
optionalElementSpec_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
optionalElementSpecCase_ = OptionalElementSpecOneofCase.ElementSpec;
}
}
/// <summary>Field number for the "compression" field.</summary>
public const int CompressionFieldNumber = 2;
private global::Tensorflow.Data.DataServiceMetadata.Types.Compression compression_ = global::Tensorflow.Data.DataServiceMetadata.Types.Compression.Unspecified;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::Tensorflow.Data.DataServiceMetadata.Types.Compression Compression {
get { return compression_; }
set {
compression_ = value;
}
}
/// <summary>Field number for the "cardinality" field.</summary>
public const int CardinalityFieldNumber = 3;
private long cardinality_;
/// <summary>
/// Cardinality of the dataset.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public long Cardinality {
get { return cardinality_; }
set {
cardinality_ = value;
}
}
private object optionalElementSpec_;
/// <summary>Enum of possible cases for the "optional_element_spec" oneof.</summary>
public enum OptionalElementSpecOneofCase {
None = 0,
ElementSpec = 1,
}
private OptionalElementSpecOneofCase optionalElementSpecCase_ = OptionalElementSpecOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public OptionalElementSpecOneofCase OptionalElementSpecCase {
get { return optionalElementSpecCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void ClearOptionalElementSpec() {
optionalElementSpecCase_ = OptionalElementSpecOneofCase.None;
optionalElementSpec_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as DataServiceMetadata);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(DataServiceMetadata other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ElementSpec != other.ElementSpec) return false;
if (Compression != other.Compression) return false;
if (Cardinality != other.Cardinality) return false;
if (OptionalElementSpecCase != other.OptionalElementSpecCase) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (optionalElementSpecCase_ == OptionalElementSpecOneofCase.ElementSpec) hash ^= ElementSpec.GetHashCode();
if (Compression != global::Tensorflow.Data.DataServiceMetadata.Types.Compression.Unspecified) hash ^= Compression.GetHashCode();
if (Cardinality != 0L) hash ^= Cardinality.GetHashCode();
hash ^= (int) optionalElementSpecCase_;
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (optionalElementSpecCase_ == OptionalElementSpecOneofCase.ElementSpec) {
output.WriteRawTag(10);
output.WriteBytes(ElementSpec);
}
if (Compression != global::Tensorflow.Data.DataServiceMetadata.Types.Compression.Unspecified) {
output.WriteRawTag(16);
output.WriteEnum((int) Compression);
}
if (Cardinality != 0L) {
output.WriteRawTag(24);
output.WriteInt64(Cardinality);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (optionalElementSpecCase_ == OptionalElementSpecOneofCase.ElementSpec) {
output.WriteRawTag(10);
output.WriteBytes(ElementSpec);
}
if (Compression != global::Tensorflow.Data.DataServiceMetadata.Types.Compression.Unspecified) {
output.WriteRawTag(16);
output.WriteEnum((int) Compression);
}
if (Cardinality != 0L) {
output.WriteRawTag(24);
output.WriteInt64(Cardinality);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (optionalElementSpecCase_ == OptionalElementSpecOneofCase.ElementSpec) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(ElementSpec);
}
if (Compression != global::Tensorflow.Data.DataServiceMetadata.Types.Compression.Unspecified) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Compression);
}
if (Cardinality != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Cardinality);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(DataServiceMetadata other) {
if (other == null) {
return;
}
if (other.Compression != global::Tensorflow.Data.DataServiceMetadata.Types.Compression.Unspecified) {
Compression = other.Compression;
}
if (other.Cardinality != 0L) {
Cardinality = other.Cardinality;
}
switch (other.OptionalElementSpecCase) {
case OptionalElementSpecOneofCase.ElementSpec:
ElementSpec = other.ElementSpec;
break;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
ElementSpec = input.ReadBytes();
break;
}
case 16: {
Compression = (global::Tensorflow.Data.DataServiceMetadata.Types.Compression) input.ReadEnum();
break;
}
case 24: {
Cardinality = input.ReadInt64();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
ElementSpec = input.ReadBytes();
break;
}
case 16: {
Compression = (global::Tensorflow.Data.DataServiceMetadata.Types.Compression) input.ReadEnum();
break;
}
case 24: {
Cardinality = input.ReadInt64();
break;
}
}
}
}
#endif
#region Nested types
/// <summary>Container for nested types declared in the DataServiceMetadata message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static partial class Types {
public enum Compression {
[pbr::OriginalName("COMPRESSION_UNSPECIFIED")] Unspecified = 0,
/// <summary>
/// No compression.
/// </summary>
[pbr::OriginalName("COMPRESSION_OFF")] Off = 1,
/// <summary>
/// Snappy compression as defined in tensorflow/core/platform/snappy.h.
/// </summary>
[pbr::OriginalName("COMPRESSION_SNAPPY")] Snappy = 2,
}
}
#endregion
}
public sealed partial class CrossTrainerCacheOptions : pb::IMessage<CrossTrainerCacheOptions>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<CrossTrainerCacheOptions> _parser = new pb::MessageParser<CrossTrainerCacheOptions>(() => new CrossTrainerCacheOptions());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<CrossTrainerCacheOptions> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Data.DataServiceReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public CrossTrainerCacheOptions() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public CrossTrainerCacheOptions(CrossTrainerCacheOptions other) : this() {
trainerId_ = other.trainerId_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public CrossTrainerCacheOptions Clone() {
return new CrossTrainerCacheOptions(this);
}
/// <summary>Field number for the "trainer_id" field.</summary>
public const int TrainerIdFieldNumber = 1;
private string trainerId_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string TrainerId {
get { return trainerId_; }
set {
trainerId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as CrossTrainerCacheOptions);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(CrossTrainerCacheOptions other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (TrainerId != other.TrainerId) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (TrainerId.Length != 0) hash ^= TrainerId.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (TrainerId.Length != 0) {
output.WriteRawTag(10);
output.WriteString(TrainerId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (TrainerId.Length != 0) {
output.WriteRawTag(10);
output.WriteString(TrainerId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (TrainerId.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(TrainerId);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(CrossTrainerCacheOptions other) {
if (other == null) {
return;
}
if (other.TrainerId.Length != 0) {
TrainerId = other.TrainerId;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
TrainerId = input.ReadString();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
TrainerId = input.ReadString();
break;
}
}
}
}
#endif
}
/// <summary>
/// Data service config available to the client through GetDataServiceConfig RPC.
/// Next tag: 2
/// </summary>
public sealed partial class DataServiceConfig : pb::IMessage<DataServiceConfig>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<DataServiceConfig> _parser = new pb::MessageParser<DataServiceConfig>(() => new DataServiceConfig());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<DataServiceConfig> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Tensorflow.Data.DataServiceReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public DataServiceConfig() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public DataServiceConfig(DataServiceConfig other) : this() {
deploymentMode_ = other.deploymentMode_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public DataServiceConfig Clone() {
return new DataServiceConfig(this);
}
/// <summary>Field number for the "deployment_mode" field.</summary>
public const int DeploymentModeFieldNumber = 1;
private global::Tensorflow.Data.DeploymentMode deploymentMode_ = global::Tensorflow.Data.DeploymentMode.Unspecified;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::Tensorflow.Data.DeploymentMode DeploymentMode {
get { return deploymentMode_; }
set {
deploymentMode_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as DataServiceConfig);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(DataServiceConfig other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (DeploymentMode != other.DeploymentMode) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (DeploymentMode != global::Tensorflow.Data.DeploymentMode.Unspecified) hash ^= DeploymentMode.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (DeploymentMode != global::Tensorflow.Data.DeploymentMode.Unspecified) {
output.WriteRawTag(8);
output.WriteEnum((int) DeploymentMode);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (DeploymentMode != global::Tensorflow.Data.DeploymentMode.Unspecified) {
output.WriteRawTag(8);
output.WriteEnum((int) DeploymentMode);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (DeploymentMode != global::Tensorflow.Data.DeploymentMode.Unspecified) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DeploymentMode);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(DataServiceConfig other) {
if (other == null) {
return;
}
if (other.DeploymentMode != global::Tensorflow.Data.DeploymentMode.Unspecified) {
DeploymentMode = other.DeploymentMode;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else