You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Cluster.cs 17 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: tensorflow/core/protobuf/cluster.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021, 8981
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace Tensorflow {
  12. /// <summary>Holder for reflection information generated from tensorflow/core/protobuf/cluster.proto</summary>
  13. public static partial class ClusterReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for tensorflow/core/protobuf/cluster.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static ClusterReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "CiZ0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvY2x1c3Rlci5wcm90bxIKdGVu",
  24. "c29yZmxvdyJyCgZKb2JEZWYSDAoEbmFtZRgBIAEoCRIsCgV0YXNrcxgCIAMo",
  25. "CzIdLnRlbnNvcmZsb3cuSm9iRGVmLlRhc2tzRW50cnkaLAoKVGFza3NFbnRy",
  26. "eRILCgNrZXkYASABKAUSDQoFdmFsdWUYAiABKAk6AjgBIi0KCkNsdXN0ZXJE",
  27. "ZWYSHwoDam9iGAEgAygLMhIudGVuc29yZmxvdy5Kb2JEZWZChwEKGm9yZy50",
  28. "ZW5zb3JmbG93LmRpc3RydW50aW1lQg1DbHVzdGVyUHJvdG9zUAFaVWdpdGh1",
  29. "Yi5jb20vdGVuc29yZmxvdy90ZW5zb3JmbG93L3RlbnNvcmZsb3cvZ28vY29y",
  30. "ZS9wcm90b2J1Zi9mb3JfY29yZV9wcm90b3NfZ29fcHJvdG/4AQFiBnByb3Rv",
  31. "Mw=="));
  32. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  33. new pbr::FileDescriptor[] { },
  34. new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
  35. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.JobDef), global::Tensorflow.JobDef.Parser, new[]{ "Name", "Tasks" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
  36. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ClusterDef), global::Tensorflow.ClusterDef.Parser, new[]{ "Job" }, null, null, null, null)
  37. }));
  38. }
  39. #endregion
  40. }
  41. #region Messages
  42. /// <summary>
  43. /// Defines a single job in a TensorFlow cluster.
  44. /// </summary>
  45. public sealed partial class JobDef : pb::IMessage<JobDef>
  46. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  47. , pb::IBufferMessage
  48. #endif
  49. {
  50. private static readonly pb::MessageParser<JobDef> _parser = new pb::MessageParser<JobDef>(() => new JobDef());
  51. private pb::UnknownFieldSet _unknownFields;
  52. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  53. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  54. public static pb::MessageParser<JobDef> Parser { get { return _parser; } }
  55. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  56. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  57. public static pbr::MessageDescriptor Descriptor {
  58. get { return global::Tensorflow.ClusterReflection.Descriptor.MessageTypes[0]; }
  59. }
  60. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  61. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  62. pbr::MessageDescriptor pb::IMessage.Descriptor {
  63. get { return Descriptor; }
  64. }
  65. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  66. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  67. public JobDef() {
  68. OnConstruction();
  69. }
  70. partial void OnConstruction();
  71. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  72. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  73. public JobDef(JobDef other) : this() {
  74. name_ = other.name_;
  75. tasks_ = other.tasks_.Clone();
  76. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  77. }
  78. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  79. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  80. public JobDef Clone() {
  81. return new JobDef(this);
  82. }
  83. /// <summary>Field number for the "name" field.</summary>
  84. public const int NameFieldNumber = 1;
  85. private string name_ = "";
  86. /// <summary>
  87. /// The name of this job.
  88. /// </summary>
  89. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  90. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  91. public string Name {
  92. get { return name_; }
  93. set {
  94. name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  95. }
  96. }
  97. /// <summary>Field number for the "tasks" field.</summary>
  98. public const int TasksFieldNumber = 2;
  99. private static readonly pbc::MapField<int, string>.Codec _map_tasks_codec
  100. = new pbc::MapField<int, string>.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForString(18, ""), 18);
  101. private readonly pbc::MapField<int, string> tasks_ = new pbc::MapField<int, string>();
  102. /// <summary>
  103. /// Mapping from task ID to "hostname:port" string.
  104. ///
  105. /// If the `name` field contains "worker", and the `tasks` map contains a
  106. /// mapping from 7 to "example.org:2222", then the device prefix
  107. /// "/job:worker/task:7" will be assigned to "example.org:2222".
  108. /// </summary>
  109. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  110. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  111. public pbc::MapField<int, string> Tasks {
  112. get { return tasks_; }
  113. }
  114. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  115. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  116. public override bool Equals(object other) {
  117. return Equals(other as JobDef);
  118. }
  119. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  120. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  121. public bool Equals(JobDef other) {
  122. if (ReferenceEquals(other, null)) {
  123. return false;
  124. }
  125. if (ReferenceEquals(other, this)) {
  126. return true;
  127. }
  128. if (Name != other.Name) return false;
  129. if (!Tasks.Equals(other.Tasks)) return false;
  130. return Equals(_unknownFields, other._unknownFields);
  131. }
  132. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  133. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  134. public override int GetHashCode() {
  135. int hash = 1;
  136. if (Name.Length != 0) hash ^= Name.GetHashCode();
  137. hash ^= Tasks.GetHashCode();
  138. if (_unknownFields != null) {
  139. hash ^= _unknownFields.GetHashCode();
  140. }
  141. return hash;
  142. }
  143. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  144. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  145. public override string ToString() {
  146. return pb::JsonFormatter.ToDiagnosticString(this);
  147. }
  148. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  149. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  150. public void WriteTo(pb::CodedOutputStream output) {
  151. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  152. output.WriteRawMessage(this);
  153. #else
  154. if (Name.Length != 0) {
  155. output.WriteRawTag(10);
  156. output.WriteString(Name);
  157. }
  158. tasks_.WriteTo(output, _map_tasks_codec);
  159. if (_unknownFields != null) {
  160. _unknownFields.WriteTo(output);
  161. }
  162. #endif
  163. }
  164. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  165. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  166. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  167. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  168. if (Name.Length != 0) {
  169. output.WriteRawTag(10);
  170. output.WriteString(Name);
  171. }
  172. tasks_.WriteTo(ref output, _map_tasks_codec);
  173. if (_unknownFields != null) {
  174. _unknownFields.WriteTo(ref output);
  175. }
  176. }
  177. #endif
  178. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  179. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  180. public int CalculateSize() {
  181. int size = 0;
  182. if (Name.Length != 0) {
  183. size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
  184. }
  185. size += tasks_.CalculateSize(_map_tasks_codec);
  186. if (_unknownFields != null) {
  187. size += _unknownFields.CalculateSize();
  188. }
  189. return size;
  190. }
  191. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  192. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  193. public void MergeFrom(JobDef other) {
  194. if (other == null) {
  195. return;
  196. }
  197. if (other.Name.Length != 0) {
  198. Name = other.Name;
  199. }
  200. tasks_.Add(other.tasks_);
  201. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  202. }
  203. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  204. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  205. public void MergeFrom(pb::CodedInputStream input) {
  206. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  207. input.ReadRawMessage(this);
  208. #else
  209. uint tag;
  210. while ((tag = input.ReadTag()) != 0) {
  211. switch(tag) {
  212. default:
  213. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  214. break;
  215. case 10: {
  216. Name = input.ReadString();
  217. break;
  218. }
  219. case 18: {
  220. tasks_.AddEntriesFrom(input, _map_tasks_codec);
  221. break;
  222. }
  223. }
  224. }
  225. #endif
  226. }
  227. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  228. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  229. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  230. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  231. uint tag;
  232. while ((tag = input.ReadTag()) != 0) {
  233. switch(tag) {
  234. default:
  235. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  236. break;
  237. case 10: {
  238. Name = input.ReadString();
  239. break;
  240. }
  241. case 18: {
  242. tasks_.AddEntriesFrom(ref input, _map_tasks_codec);
  243. break;
  244. }
  245. }
  246. }
  247. }
  248. #endif
  249. }
  250. /// <summary>
  251. /// Defines a TensorFlow cluster as a set of jobs.
  252. /// </summary>
  253. public sealed partial class ClusterDef : pb::IMessage<ClusterDef>
  254. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  255. , pb::IBufferMessage
  256. #endif
  257. {
  258. private static readonly pb::MessageParser<ClusterDef> _parser = new pb::MessageParser<ClusterDef>(() => new ClusterDef());
  259. private pb::UnknownFieldSet _unknownFields;
  260. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  261. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  262. public static pb::MessageParser<ClusterDef> Parser { get { return _parser; } }
  263. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  264. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  265. public static pbr::MessageDescriptor Descriptor {
  266. get { return global::Tensorflow.ClusterReflection.Descriptor.MessageTypes[1]; }
  267. }
  268. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  269. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  270. pbr::MessageDescriptor pb::IMessage.Descriptor {
  271. get { return Descriptor; }
  272. }
  273. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  274. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  275. public ClusterDef() {
  276. OnConstruction();
  277. }
  278. partial void OnConstruction();
  279. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  280. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  281. public ClusterDef(ClusterDef other) : this() {
  282. job_ = other.job_.Clone();
  283. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  284. }
  285. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  286. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  287. public ClusterDef Clone() {
  288. return new ClusterDef(this);
  289. }
  290. /// <summary>Field number for the "job" field.</summary>
  291. public const int JobFieldNumber = 1;
  292. private static readonly pb::FieldCodec<global::Tensorflow.JobDef> _repeated_job_codec
  293. = pb::FieldCodec.ForMessage(10, global::Tensorflow.JobDef.Parser);
  294. private readonly pbc::RepeatedField<global::Tensorflow.JobDef> job_ = new pbc::RepeatedField<global::Tensorflow.JobDef>();
  295. /// <summary>
  296. /// The jobs that comprise the cluster.
  297. /// </summary>
  298. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  299. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  300. public pbc::RepeatedField<global::Tensorflow.JobDef> Job {
  301. get { return job_; }
  302. }
  303. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  304. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  305. public override bool Equals(object other) {
  306. return Equals(other as ClusterDef);
  307. }
  308. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  309. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  310. public bool Equals(ClusterDef other) {
  311. if (ReferenceEquals(other, null)) {
  312. return false;
  313. }
  314. if (ReferenceEquals(other, this)) {
  315. return true;
  316. }
  317. if(!job_.Equals(other.job_)) return false;
  318. return Equals(_unknownFields, other._unknownFields);
  319. }
  320. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  321. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  322. public override int GetHashCode() {
  323. int hash = 1;
  324. hash ^= job_.GetHashCode();
  325. if (_unknownFields != null) {
  326. hash ^= _unknownFields.GetHashCode();
  327. }
  328. return hash;
  329. }
  330. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  331. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  332. public override string ToString() {
  333. return pb::JsonFormatter.ToDiagnosticString(this);
  334. }
  335. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  336. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  337. public void WriteTo(pb::CodedOutputStream output) {
  338. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  339. output.WriteRawMessage(this);
  340. #else
  341. job_.WriteTo(output, _repeated_job_codec);
  342. if (_unknownFields != null) {
  343. _unknownFields.WriteTo(output);
  344. }
  345. #endif
  346. }
  347. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  348. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  349. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  350. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  351. job_.WriteTo(ref output, _repeated_job_codec);
  352. if (_unknownFields != null) {
  353. _unknownFields.WriteTo(ref output);
  354. }
  355. }
  356. #endif
  357. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  358. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  359. public int CalculateSize() {
  360. int size = 0;
  361. size += job_.CalculateSize(_repeated_job_codec);
  362. if (_unknownFields != null) {
  363. size += _unknownFields.CalculateSize();
  364. }
  365. return size;
  366. }
  367. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  368. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  369. public void MergeFrom(ClusterDef other) {
  370. if (other == null) {
  371. return;
  372. }
  373. job_.Add(other.job_);
  374. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  375. }
  376. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  377. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  378. public void MergeFrom(pb::CodedInputStream input) {
  379. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  380. input.ReadRawMessage(this);
  381. #else
  382. uint tag;
  383. while ((tag = input.ReadTag()) != 0) {
  384. switch(tag) {
  385. default:
  386. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  387. break;
  388. case 10: {
  389. job_.AddEntriesFrom(input, _repeated_job_codec);
  390. break;
  391. }
  392. }
  393. }
  394. #endif
  395. }
  396. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  397. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  398. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  399. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  400. uint tag;
  401. while ((tag = input.ReadTag()) != 0) {
  402. switch(tag) {
  403. default:
  404. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  405. break;
  406. case 10: {
  407. job_.AddEntriesFrom(ref input, _repeated_job_codec);
  408. break;
  409. }
  410. }
  411. }
  412. }
  413. #endif
  414. }
  415. #endregion
  416. }
  417. #endregion Designer generated code