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 12 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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
  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. "ZWYSHwoDam9iGAEgAygLMhIudGVuc29yZmxvdy5Kb2JEZWZCbgoab3JnLnRl",
  28. "bnNvcmZsb3cuZGlzdHJ1bnRpbWVCDUNsdXN0ZXJQcm90b3NQAVo8Z2l0aHVi",
  29. "LmNvbS90ZW5zb3JmbG93L3RlbnNvcmZsb3cvdGVuc29yZmxvdy9nby9jb3Jl",
  30. "L3Byb3RvYnVm+AEBYgZwcm90bzM="));
  31. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  32. new pbr::FileDescriptor[] { },
  33. new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
  34. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.JobDef), global::Tensorflow.JobDef.Parser, new[]{ "Name", "Tasks" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
  35. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ClusterDef), global::Tensorflow.ClusterDef.Parser, new[]{ "Job" }, null, null, null)
  36. }));
  37. }
  38. #endregion
  39. }
  40. #region Messages
  41. /// <summary>
  42. /// Defines a single job in a TensorFlow cluster.
  43. /// </summary>
  44. public sealed partial class JobDef : pb::IMessage<JobDef> {
  45. private static readonly pb::MessageParser<JobDef> _parser = new pb::MessageParser<JobDef>(() => new JobDef());
  46. private pb::UnknownFieldSet _unknownFields;
  47. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  48. public static pb::MessageParser<JobDef> Parser { get { return _parser; } }
  49. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  50. public static pbr::MessageDescriptor Descriptor {
  51. get { return global::Tensorflow.ClusterReflection.Descriptor.MessageTypes[0]; }
  52. }
  53. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  54. pbr::MessageDescriptor pb::IMessage.Descriptor {
  55. get { return Descriptor; }
  56. }
  57. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  58. public JobDef() {
  59. OnConstruction();
  60. }
  61. partial void OnConstruction();
  62. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  63. public JobDef(JobDef other) : this() {
  64. name_ = other.name_;
  65. tasks_ = other.tasks_.Clone();
  66. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  67. }
  68. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  69. public JobDef Clone() {
  70. return new JobDef(this);
  71. }
  72. /// <summary>Field number for the "name" field.</summary>
  73. public const int NameFieldNumber = 1;
  74. private string name_ = "";
  75. /// <summary>
  76. /// The name of this job.
  77. /// </summary>
  78. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  79. public string Name {
  80. get { return name_; }
  81. set {
  82. name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  83. }
  84. }
  85. /// <summary>Field number for the "tasks" field.</summary>
  86. public const int TasksFieldNumber = 2;
  87. private static readonly pbc::MapField<int, string>.Codec _map_tasks_codec
  88. = new pbc::MapField<int, string>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForString(18), 18);
  89. private readonly pbc::MapField<int, string> tasks_ = new pbc::MapField<int, string>();
  90. /// <summary>
  91. /// Mapping from task ID to "hostname:port" string.
  92. ///
  93. /// If the `name` field contains "worker", and the `tasks` map contains a
  94. /// mapping from 7 to "example.org:2222", then the device prefix
  95. /// "/job:worker/task:7" will be assigned to "example.org:2222".
  96. /// </summary>
  97. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  98. public pbc::MapField<int, string> Tasks {
  99. get { return tasks_; }
  100. }
  101. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  102. public override bool Equals(object other) {
  103. return Equals(other as JobDef);
  104. }
  105. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  106. public bool Equals(JobDef other) {
  107. if (ReferenceEquals(other, null)) {
  108. return false;
  109. }
  110. if (ReferenceEquals(other, this)) {
  111. return true;
  112. }
  113. if (Name != other.Name) return false;
  114. if (!Tasks.Equals(other.Tasks)) return false;
  115. return Equals(_unknownFields, other._unknownFields);
  116. }
  117. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  118. public override int GetHashCode() {
  119. int hash = 1;
  120. if (Name.Length != 0) hash ^= Name.GetHashCode();
  121. hash ^= Tasks.GetHashCode();
  122. if (_unknownFields != null) {
  123. hash ^= _unknownFields.GetHashCode();
  124. }
  125. return hash;
  126. }
  127. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  128. public override string ToString() {
  129. return pb::JsonFormatter.ToDiagnosticString(this);
  130. }
  131. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  132. public void WriteTo(pb::CodedOutputStream output) {
  133. if (Name.Length != 0) {
  134. output.WriteRawTag(10);
  135. output.WriteString(Name);
  136. }
  137. tasks_.WriteTo(output, _map_tasks_codec);
  138. if (_unknownFields != null) {
  139. _unknownFields.WriteTo(output);
  140. }
  141. }
  142. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  143. public int CalculateSize() {
  144. int size = 0;
  145. if (Name.Length != 0) {
  146. size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
  147. }
  148. size += tasks_.CalculateSize(_map_tasks_codec);
  149. if (_unknownFields != null) {
  150. size += _unknownFields.CalculateSize();
  151. }
  152. return size;
  153. }
  154. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  155. public void MergeFrom(JobDef other) {
  156. if (other == null) {
  157. return;
  158. }
  159. if (other.Name.Length != 0) {
  160. Name = other.Name;
  161. }
  162. tasks_.Add(other.tasks_);
  163. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  164. }
  165. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  166. public void MergeFrom(pb::CodedInputStream input) {
  167. uint tag;
  168. while ((tag = input.ReadTag()) != 0) {
  169. switch(tag) {
  170. default:
  171. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  172. break;
  173. case 10: {
  174. Name = input.ReadString();
  175. break;
  176. }
  177. case 18: {
  178. tasks_.AddEntriesFrom(input, _map_tasks_codec);
  179. break;
  180. }
  181. }
  182. }
  183. }
  184. }
  185. /// <summary>
  186. /// Defines a TensorFlow cluster as a set of jobs.
  187. /// </summary>
  188. public sealed partial class ClusterDef : pb::IMessage<ClusterDef> {
  189. private static readonly pb::MessageParser<ClusterDef> _parser = new pb::MessageParser<ClusterDef>(() => new ClusterDef());
  190. private pb::UnknownFieldSet _unknownFields;
  191. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  192. public static pb::MessageParser<ClusterDef> Parser { get { return _parser; } }
  193. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  194. public static pbr::MessageDescriptor Descriptor {
  195. get { return global::Tensorflow.ClusterReflection.Descriptor.MessageTypes[1]; }
  196. }
  197. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  198. pbr::MessageDescriptor pb::IMessage.Descriptor {
  199. get { return Descriptor; }
  200. }
  201. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  202. public ClusterDef() {
  203. OnConstruction();
  204. }
  205. partial void OnConstruction();
  206. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  207. public ClusterDef(ClusterDef other) : this() {
  208. job_ = other.job_.Clone();
  209. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  210. }
  211. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  212. public ClusterDef Clone() {
  213. return new ClusterDef(this);
  214. }
  215. /// <summary>Field number for the "job" field.</summary>
  216. public const int JobFieldNumber = 1;
  217. private static readonly pb::FieldCodec<global::Tensorflow.JobDef> _repeated_job_codec
  218. = pb::FieldCodec.ForMessage(10, global::Tensorflow.JobDef.Parser);
  219. private readonly pbc::RepeatedField<global::Tensorflow.JobDef> job_ = new pbc::RepeatedField<global::Tensorflow.JobDef>();
  220. /// <summary>
  221. /// The jobs that comprise the cluster.
  222. /// </summary>
  223. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  224. public pbc::RepeatedField<global::Tensorflow.JobDef> Job {
  225. get { return job_; }
  226. }
  227. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  228. public override bool Equals(object other) {
  229. return Equals(other as ClusterDef);
  230. }
  231. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  232. public bool Equals(ClusterDef other) {
  233. if (ReferenceEquals(other, null)) {
  234. return false;
  235. }
  236. if (ReferenceEquals(other, this)) {
  237. return true;
  238. }
  239. if(!job_.Equals(other.job_)) return false;
  240. return Equals(_unknownFields, other._unknownFields);
  241. }
  242. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  243. public override int GetHashCode() {
  244. int hash = 1;
  245. hash ^= job_.GetHashCode();
  246. if (_unknownFields != null) {
  247. hash ^= _unknownFields.GetHashCode();
  248. }
  249. return hash;
  250. }
  251. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  252. public override string ToString() {
  253. return pb::JsonFormatter.ToDiagnosticString(this);
  254. }
  255. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  256. public void WriteTo(pb::CodedOutputStream output) {
  257. job_.WriteTo(output, _repeated_job_codec);
  258. if (_unknownFields != null) {
  259. _unknownFields.WriteTo(output);
  260. }
  261. }
  262. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  263. public int CalculateSize() {
  264. int size = 0;
  265. size += job_.CalculateSize(_repeated_job_codec);
  266. if (_unknownFields != null) {
  267. size += _unknownFields.CalculateSize();
  268. }
  269. return size;
  270. }
  271. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  272. public void MergeFrom(ClusterDef other) {
  273. if (other == null) {
  274. return;
  275. }
  276. job_.Add(other.job_);
  277. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  278. }
  279. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  280. public void MergeFrom(pb::CodedInputStream input) {
  281. uint tag;
  282. while ((tag = input.ReadTag()) != 0) {
  283. switch(tag) {
  284. default:
  285. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  286. break;
  287. case 10: {
  288. job_.AddEntriesFrom(input, _repeated_job_codec);
  289. break;
  290. }
  291. }
  292. }
  293. }
  294. }
  295. #endregion
  296. }
  297. #endregion Designer generated code