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.

ControlFlow.cs 43 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: tensorflow/core/protobuf/control_flow.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/control_flow.proto</summary>
  13. public static partial class ControlFlowReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for tensorflow/core/protobuf/control_flow.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static ControlFlowReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "Cit0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvY29udHJvbF9mbG93LnByb3Rv",
  24. "Egp0ZW5zb3JmbG93IpYBCglWYWx1ZXNEZWYSDgoGdmFsdWVzGAEgAygJEkIK",
  25. "D2V4dGVybmFsX3ZhbHVlcxgCIAMoCzIpLnRlbnNvcmZsb3cuVmFsdWVzRGVm",
  26. "LkV4dGVybmFsVmFsdWVzRW50cnkaNQoTRXh0ZXJuYWxWYWx1ZXNFbnRyeRIL",
  27. "CgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIoMBChVDb250cm9sRmxv",
  28. "d0NvbnRleHREZWYSLwoJY29uZF9jdHh0GAEgASgLMhoudGVuc29yZmxvdy5D",
  29. "b25kQ29udGV4dERlZkgAEjEKCndoaWxlX2N0eHQYAiABKAsyGy50ZW5zb3Jm",
  30. "bG93LldoaWxlQ29udGV4dERlZkgAQgYKBGN0eHQixAEKDkNvbmRDb250ZXh0",
  31. "RGVmEhQKDGNvbnRleHRfbmFtZRgBIAEoCRIRCglwcmVkX25hbWUYAiABKAkS",
  32. "EgoKcGl2b3RfbmFtZRgDIAEoCRIOCgZicmFuY2gYBCABKAUSKQoKdmFsdWVz",
  33. "X2RlZhgFIAEoCzIVLnRlbnNvcmZsb3cuVmFsdWVzRGVmEjoKD25lc3RlZF9j",
  34. "b250ZXh0cxgGIAMoCzIhLnRlbnNvcmZsb3cuQ29udHJvbEZsb3dDb250ZXh0",
  35. "RGVmIvUCCg9XaGlsZUNvbnRleHREZWYSFAoMY29udGV4dF9uYW1lGAEgASgJ",
  36. "EhsKE3BhcmFsbGVsX2l0ZXJhdGlvbnMYAiABKAUSEQoJYmFja19wcm9wGAMg",
  37. "ASgIEhMKC3N3YXBfbWVtb3J5GAQgASgIEhIKCnBpdm90X25hbWUYBSABKAkS",
  38. "GwoTcGl2b3RfZm9yX3ByZWRfbmFtZRgGIAEoCRIbChNwaXZvdF9mb3JfYm9k",
  39. "eV9uYW1lGAcgASgJEhcKD2xvb3BfZXhpdF9uYW1lcxgIIAMoCRIYChBsb29w",
  40. "X2VudGVyX25hbWVzGAogAygJEikKCnZhbHVlc19kZWYYCSABKAsyFS50ZW5z",
  41. "b3JmbG93LlZhbHVlc0RlZhIfChdtYXhpbXVtX2l0ZXJhdGlvbnNfbmFtZRgL",
  42. "IAEoCRI6Cg9uZXN0ZWRfY29udGV4dHMYDCADKAsyIS50ZW5zb3JmbG93LkNv",
  43. "bnRyb2xGbG93Q29udGV4dERlZkJwChhvcmcudGVuc29yZmxvdy5mcmFtZXdv",
  44. "cmtCEUNvbnRyb2xGbG93UHJvdG9zUAFaPGdpdGh1Yi5jb20vdGVuc29yZmxv",
  45. "dy90ZW5zb3JmbG93L3RlbnNvcmZsb3cvZ28vY29yZS9wcm90b2J1ZvgBAWIG",
  46. "cHJvdG8z"));
  47. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  48. new pbr::FileDescriptor[] { },
  49. new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
  50. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ValuesDef), global::Tensorflow.ValuesDef.Parser, new[]{ "Values", "ExternalValues" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
  51. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ControlFlowContextDef), global::Tensorflow.ControlFlowContextDef.Parser, new[]{ "CondCtxt", "WhileCtxt" }, new[]{ "Ctxt" }, null, null),
  52. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.CondContextDef), global::Tensorflow.CondContextDef.Parser, new[]{ "ContextName", "PredName", "PivotName", "Branch", "ValuesDef", "NestedContexts" }, null, null, null),
  53. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.WhileContextDef), global::Tensorflow.WhileContextDef.Parser, new[]{ "ContextName", "ParallelIterations", "BackProp", "SwapMemory", "PivotName", "PivotForPredName", "PivotForBodyName", "LoopExitNames", "LoopEnterNames", "ValuesDef", "MaximumIterationsName", "NestedContexts" }, null, null, null)
  54. }));
  55. }
  56. #endregion
  57. }
  58. #region Messages
  59. /// <summary>
  60. /// Protocol buffer representing the values in ControlFlowContext.
  61. /// </summary>
  62. public sealed partial class ValuesDef : pb::IMessage<ValuesDef> {
  63. private static readonly pb::MessageParser<ValuesDef> _parser = new pb::MessageParser<ValuesDef>(() => new ValuesDef());
  64. private pb::UnknownFieldSet _unknownFields;
  65. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  66. public static pb::MessageParser<ValuesDef> Parser { get { return _parser; } }
  67. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  68. public static pbr::MessageDescriptor Descriptor {
  69. get { return global::Tensorflow.ControlFlowReflection.Descriptor.MessageTypes[0]; }
  70. }
  71. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  72. pbr::MessageDescriptor pb::IMessage.Descriptor {
  73. get { return Descriptor; }
  74. }
  75. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  76. public ValuesDef() {
  77. OnConstruction();
  78. }
  79. partial void OnConstruction();
  80. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  81. public ValuesDef(ValuesDef other) : this() {
  82. values_ = other.values_.Clone();
  83. externalValues_ = other.externalValues_.Clone();
  84. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  85. }
  86. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  87. public ValuesDef Clone() {
  88. return new ValuesDef(this);
  89. }
  90. /// <summary>Field number for the "values" field.</summary>
  91. public const int ValuesFieldNumber = 1;
  92. private static readonly pb::FieldCodec<string> _repeated_values_codec
  93. = pb::FieldCodec.ForString(10);
  94. private readonly pbc::RepeatedField<string> values_ = new pbc::RepeatedField<string>();
  95. /// <summary>
  96. /// Value names that have been seen in this context.
  97. /// </summary>
  98. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  99. public pbc::RepeatedField<string> Values {
  100. get { return values_; }
  101. }
  102. /// <summary>Field number for the "external_values" field.</summary>
  103. public const int ExternalValuesFieldNumber = 2;
  104. private static readonly pbc::MapField<string, string>.Codec _map_externalValues_codec
  105. = new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 18);
  106. private readonly pbc::MapField<string, string> externalValues_ = new pbc::MapField<string, string>();
  107. /// <summary>
  108. /// Value names referenced by but external to this context.
  109. /// </summary>
  110. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  111. public pbc::MapField<string, string> ExternalValues {
  112. get { return externalValues_; }
  113. }
  114. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  115. public override bool Equals(object other) {
  116. return Equals(other as ValuesDef);
  117. }
  118. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  119. public bool Equals(ValuesDef other) {
  120. if (ReferenceEquals(other, null)) {
  121. return false;
  122. }
  123. if (ReferenceEquals(other, this)) {
  124. return true;
  125. }
  126. if(!values_.Equals(other.values_)) return false;
  127. if (!ExternalValues.Equals(other.ExternalValues)) return false;
  128. return Equals(_unknownFields, other._unknownFields);
  129. }
  130. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  131. public override int GetHashCode() {
  132. int hash = 1;
  133. hash ^= values_.GetHashCode();
  134. hash ^= ExternalValues.GetHashCode();
  135. if (_unknownFields != null) {
  136. hash ^= _unknownFields.GetHashCode();
  137. }
  138. return hash;
  139. }
  140. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  141. public override string ToString() {
  142. return pb::JsonFormatter.ToDiagnosticString(this);
  143. }
  144. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  145. public void WriteTo(pb::CodedOutputStream output) {
  146. values_.WriteTo(output, _repeated_values_codec);
  147. externalValues_.WriteTo(output, _map_externalValues_codec);
  148. if (_unknownFields != null) {
  149. _unknownFields.WriteTo(output);
  150. }
  151. }
  152. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  153. public int CalculateSize() {
  154. int size = 0;
  155. size += values_.CalculateSize(_repeated_values_codec);
  156. size += externalValues_.CalculateSize(_map_externalValues_codec);
  157. if (_unknownFields != null) {
  158. size += _unknownFields.CalculateSize();
  159. }
  160. return size;
  161. }
  162. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  163. public void MergeFrom(ValuesDef other) {
  164. if (other == null) {
  165. return;
  166. }
  167. values_.Add(other.values_);
  168. externalValues_.Add(other.externalValues_);
  169. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  170. }
  171. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  172. public void MergeFrom(pb::CodedInputStream input) {
  173. uint tag;
  174. while ((tag = input.ReadTag()) != 0) {
  175. switch(tag) {
  176. default:
  177. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  178. break;
  179. case 10: {
  180. values_.AddEntriesFrom(input, _repeated_values_codec);
  181. break;
  182. }
  183. case 18: {
  184. externalValues_.AddEntriesFrom(input, _map_externalValues_codec);
  185. break;
  186. }
  187. }
  188. }
  189. }
  190. }
  191. /// <summary>
  192. /// Container for any kind of control flow context. Any other control flow
  193. /// contexts that are added below should also be added here.
  194. /// </summary>
  195. public sealed partial class ControlFlowContextDef : pb::IMessage<ControlFlowContextDef> {
  196. private static readonly pb::MessageParser<ControlFlowContextDef> _parser = new pb::MessageParser<ControlFlowContextDef>(() => new ControlFlowContextDef());
  197. private pb::UnknownFieldSet _unknownFields;
  198. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  199. public static pb::MessageParser<ControlFlowContextDef> Parser { get { return _parser; } }
  200. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  201. public static pbr::MessageDescriptor Descriptor {
  202. get { return global::Tensorflow.ControlFlowReflection.Descriptor.MessageTypes[1]; }
  203. }
  204. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  205. pbr::MessageDescriptor pb::IMessage.Descriptor {
  206. get { return Descriptor; }
  207. }
  208. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  209. public ControlFlowContextDef() {
  210. OnConstruction();
  211. }
  212. partial void OnConstruction();
  213. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  214. public ControlFlowContextDef(ControlFlowContextDef other) : this() {
  215. switch (other.CtxtCase) {
  216. case CtxtOneofCase.CondCtxt:
  217. CondCtxt = other.CondCtxt.Clone();
  218. break;
  219. case CtxtOneofCase.WhileCtxt:
  220. WhileCtxt = other.WhileCtxt.Clone();
  221. break;
  222. }
  223. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  224. }
  225. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  226. public ControlFlowContextDef Clone() {
  227. return new ControlFlowContextDef(this);
  228. }
  229. /// <summary>Field number for the "cond_ctxt" field.</summary>
  230. public const int CondCtxtFieldNumber = 1;
  231. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  232. public global::Tensorflow.CondContextDef CondCtxt {
  233. get { return ctxtCase_ == CtxtOneofCase.CondCtxt ? (global::Tensorflow.CondContextDef) ctxt_ : null; }
  234. set {
  235. ctxt_ = value;
  236. ctxtCase_ = value == null ? CtxtOneofCase.None : CtxtOneofCase.CondCtxt;
  237. }
  238. }
  239. /// <summary>Field number for the "while_ctxt" field.</summary>
  240. public const int WhileCtxtFieldNumber = 2;
  241. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  242. public global::Tensorflow.WhileContextDef WhileCtxt {
  243. get { return ctxtCase_ == CtxtOneofCase.WhileCtxt ? (global::Tensorflow.WhileContextDef) ctxt_ : null; }
  244. set {
  245. ctxt_ = value;
  246. ctxtCase_ = value == null ? CtxtOneofCase.None : CtxtOneofCase.WhileCtxt;
  247. }
  248. }
  249. private object ctxt_;
  250. /// <summary>Enum of possible cases for the "ctxt" oneof.</summary>
  251. public enum CtxtOneofCase {
  252. None = 0,
  253. CondCtxt = 1,
  254. WhileCtxt = 2,
  255. }
  256. private CtxtOneofCase ctxtCase_ = CtxtOneofCase.None;
  257. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  258. public CtxtOneofCase CtxtCase {
  259. get { return ctxtCase_; }
  260. }
  261. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  262. public void ClearCtxt() {
  263. ctxtCase_ = CtxtOneofCase.None;
  264. ctxt_ = null;
  265. }
  266. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  267. public override bool Equals(object other) {
  268. return Equals(other as ControlFlowContextDef);
  269. }
  270. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  271. public bool Equals(ControlFlowContextDef other) {
  272. if (ReferenceEquals(other, null)) {
  273. return false;
  274. }
  275. if (ReferenceEquals(other, this)) {
  276. return true;
  277. }
  278. if (!object.Equals(CondCtxt, other.CondCtxt)) return false;
  279. if (!object.Equals(WhileCtxt, other.WhileCtxt)) return false;
  280. if (CtxtCase != other.CtxtCase) return false;
  281. return Equals(_unknownFields, other._unknownFields);
  282. }
  283. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  284. public override int GetHashCode() {
  285. int hash = 1;
  286. if (ctxtCase_ == CtxtOneofCase.CondCtxt) hash ^= CondCtxt.GetHashCode();
  287. if (ctxtCase_ == CtxtOneofCase.WhileCtxt) hash ^= WhileCtxt.GetHashCode();
  288. hash ^= (int) ctxtCase_;
  289. if (_unknownFields != null) {
  290. hash ^= _unknownFields.GetHashCode();
  291. }
  292. return hash;
  293. }
  294. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  295. public override string ToString() {
  296. return pb::JsonFormatter.ToDiagnosticString(this);
  297. }
  298. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  299. public void WriteTo(pb::CodedOutputStream output) {
  300. if (ctxtCase_ == CtxtOneofCase.CondCtxt) {
  301. output.WriteRawTag(10);
  302. output.WriteMessage(CondCtxt);
  303. }
  304. if (ctxtCase_ == CtxtOneofCase.WhileCtxt) {
  305. output.WriteRawTag(18);
  306. output.WriteMessage(WhileCtxt);
  307. }
  308. if (_unknownFields != null) {
  309. _unknownFields.WriteTo(output);
  310. }
  311. }
  312. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  313. public int CalculateSize() {
  314. int size = 0;
  315. if (ctxtCase_ == CtxtOneofCase.CondCtxt) {
  316. size += 1 + pb::CodedOutputStream.ComputeMessageSize(CondCtxt);
  317. }
  318. if (ctxtCase_ == CtxtOneofCase.WhileCtxt) {
  319. size += 1 + pb::CodedOutputStream.ComputeMessageSize(WhileCtxt);
  320. }
  321. if (_unknownFields != null) {
  322. size += _unknownFields.CalculateSize();
  323. }
  324. return size;
  325. }
  326. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  327. public void MergeFrom(ControlFlowContextDef other) {
  328. if (other == null) {
  329. return;
  330. }
  331. switch (other.CtxtCase) {
  332. case CtxtOneofCase.CondCtxt:
  333. if (CondCtxt == null) {
  334. CondCtxt = new global::Tensorflow.CondContextDef();
  335. }
  336. CondCtxt.MergeFrom(other.CondCtxt);
  337. break;
  338. case CtxtOneofCase.WhileCtxt:
  339. if (WhileCtxt == null) {
  340. WhileCtxt = new global::Tensorflow.WhileContextDef();
  341. }
  342. WhileCtxt.MergeFrom(other.WhileCtxt);
  343. break;
  344. }
  345. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  346. }
  347. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  348. public void MergeFrom(pb::CodedInputStream input) {
  349. uint tag;
  350. while ((tag = input.ReadTag()) != 0) {
  351. switch(tag) {
  352. default:
  353. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  354. break;
  355. case 10: {
  356. global::Tensorflow.CondContextDef subBuilder = new global::Tensorflow.CondContextDef();
  357. if (ctxtCase_ == CtxtOneofCase.CondCtxt) {
  358. subBuilder.MergeFrom(CondCtxt);
  359. }
  360. input.ReadMessage(subBuilder);
  361. CondCtxt = subBuilder;
  362. break;
  363. }
  364. case 18: {
  365. global::Tensorflow.WhileContextDef subBuilder = new global::Tensorflow.WhileContextDef();
  366. if (ctxtCase_ == CtxtOneofCase.WhileCtxt) {
  367. subBuilder.MergeFrom(WhileCtxt);
  368. }
  369. input.ReadMessage(subBuilder);
  370. WhileCtxt = subBuilder;
  371. break;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. /// <summary>
  378. /// Protocol buffer representing a CondContext object.
  379. /// </summary>
  380. public sealed partial class CondContextDef : pb::IMessage<CondContextDef> {
  381. private static readonly pb::MessageParser<CondContextDef> _parser = new pb::MessageParser<CondContextDef>(() => new CondContextDef());
  382. private pb::UnknownFieldSet _unknownFields;
  383. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  384. public static pb::MessageParser<CondContextDef> Parser { get { return _parser; } }
  385. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  386. public static pbr::MessageDescriptor Descriptor {
  387. get { return global::Tensorflow.ControlFlowReflection.Descriptor.MessageTypes[2]; }
  388. }
  389. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  390. pbr::MessageDescriptor pb::IMessage.Descriptor {
  391. get { return Descriptor; }
  392. }
  393. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  394. public CondContextDef() {
  395. OnConstruction();
  396. }
  397. partial void OnConstruction();
  398. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  399. public CondContextDef(CondContextDef other) : this() {
  400. contextName_ = other.contextName_;
  401. predName_ = other.predName_;
  402. pivotName_ = other.pivotName_;
  403. branch_ = other.branch_;
  404. valuesDef_ = other.valuesDef_ != null ? other.valuesDef_.Clone() : null;
  405. nestedContexts_ = other.nestedContexts_.Clone();
  406. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  407. }
  408. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  409. public CondContextDef Clone() {
  410. return new CondContextDef(this);
  411. }
  412. /// <summary>Field number for the "context_name" field.</summary>
  413. public const int ContextNameFieldNumber = 1;
  414. private string contextName_ = "";
  415. /// <summary>
  416. /// Name of the context.
  417. /// </summary>
  418. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  419. public string ContextName {
  420. get { return contextName_; }
  421. set {
  422. contextName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  423. }
  424. }
  425. /// <summary>Field number for the "pred_name" field.</summary>
  426. public const int PredNameFieldNumber = 2;
  427. private string predName_ = "";
  428. /// <summary>
  429. /// Name of the pred tensor.
  430. /// </summary>
  431. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  432. public string PredName {
  433. get { return predName_; }
  434. set {
  435. predName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  436. }
  437. }
  438. /// <summary>Field number for the "pivot_name" field.</summary>
  439. public const int PivotNameFieldNumber = 3;
  440. private string pivotName_ = "";
  441. /// <summary>
  442. /// Name of the pivot tensor.
  443. /// </summary>
  444. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  445. public string PivotName {
  446. get { return pivotName_; }
  447. set {
  448. pivotName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  449. }
  450. }
  451. /// <summary>Field number for the "branch" field.</summary>
  452. public const int BranchFieldNumber = 4;
  453. private int branch_;
  454. /// <summary>
  455. /// Branch prediction. 0 or 1.
  456. /// </summary>
  457. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  458. public int Branch {
  459. get { return branch_; }
  460. set {
  461. branch_ = value;
  462. }
  463. }
  464. /// <summary>Field number for the "values_def" field.</summary>
  465. public const int ValuesDefFieldNumber = 5;
  466. private global::Tensorflow.ValuesDef valuesDef_;
  467. /// <summary>
  468. /// Values and external values in control flow context.
  469. /// </summary>
  470. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  471. public global::Tensorflow.ValuesDef ValuesDef {
  472. get { return valuesDef_; }
  473. set {
  474. valuesDef_ = value;
  475. }
  476. }
  477. /// <summary>Field number for the "nested_contexts" field.</summary>
  478. public const int NestedContextsFieldNumber = 6;
  479. private static readonly pb::FieldCodec<global::Tensorflow.ControlFlowContextDef> _repeated_nestedContexts_codec
  480. = pb::FieldCodec.ForMessage(50, global::Tensorflow.ControlFlowContextDef.Parser);
  481. private readonly pbc::RepeatedField<global::Tensorflow.ControlFlowContextDef> nestedContexts_ = new pbc::RepeatedField<global::Tensorflow.ControlFlowContextDef>();
  482. /// <summary>
  483. /// Contexts contained inside this context (e.g. nested conds).
  484. /// </summary>
  485. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  486. public pbc::RepeatedField<global::Tensorflow.ControlFlowContextDef> NestedContexts {
  487. get { return nestedContexts_; }
  488. }
  489. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  490. public override bool Equals(object other) {
  491. return Equals(other as CondContextDef);
  492. }
  493. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  494. public bool Equals(CondContextDef other) {
  495. if (ReferenceEquals(other, null)) {
  496. return false;
  497. }
  498. if (ReferenceEquals(other, this)) {
  499. return true;
  500. }
  501. if (ContextName != other.ContextName) return false;
  502. if (PredName != other.PredName) return false;
  503. if (PivotName != other.PivotName) return false;
  504. if (Branch != other.Branch) return false;
  505. if (!object.Equals(ValuesDef, other.ValuesDef)) return false;
  506. if(!nestedContexts_.Equals(other.nestedContexts_)) return false;
  507. return Equals(_unknownFields, other._unknownFields);
  508. }
  509. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  510. public override int GetHashCode() {
  511. int hash = 1;
  512. if (ContextName.Length != 0) hash ^= ContextName.GetHashCode();
  513. if (PredName.Length != 0) hash ^= PredName.GetHashCode();
  514. if (PivotName.Length != 0) hash ^= PivotName.GetHashCode();
  515. if (Branch != 0) hash ^= Branch.GetHashCode();
  516. if (valuesDef_ != null) hash ^= ValuesDef.GetHashCode();
  517. hash ^= nestedContexts_.GetHashCode();
  518. if (_unknownFields != null) {
  519. hash ^= _unknownFields.GetHashCode();
  520. }
  521. return hash;
  522. }
  523. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  524. public override string ToString() {
  525. return pb::JsonFormatter.ToDiagnosticString(this);
  526. }
  527. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  528. public void WriteTo(pb::CodedOutputStream output) {
  529. if (ContextName.Length != 0) {
  530. output.WriteRawTag(10);
  531. output.WriteString(ContextName);
  532. }
  533. if (PredName.Length != 0) {
  534. output.WriteRawTag(18);
  535. output.WriteString(PredName);
  536. }
  537. if (PivotName.Length != 0) {
  538. output.WriteRawTag(26);
  539. output.WriteString(PivotName);
  540. }
  541. if (Branch != 0) {
  542. output.WriteRawTag(32);
  543. output.WriteInt32(Branch);
  544. }
  545. if (valuesDef_ != null) {
  546. output.WriteRawTag(42);
  547. output.WriteMessage(ValuesDef);
  548. }
  549. nestedContexts_.WriteTo(output, _repeated_nestedContexts_codec);
  550. if (_unknownFields != null) {
  551. _unknownFields.WriteTo(output);
  552. }
  553. }
  554. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  555. public int CalculateSize() {
  556. int size = 0;
  557. if (ContextName.Length != 0) {
  558. size += 1 + pb::CodedOutputStream.ComputeStringSize(ContextName);
  559. }
  560. if (PredName.Length != 0) {
  561. size += 1 + pb::CodedOutputStream.ComputeStringSize(PredName);
  562. }
  563. if (PivotName.Length != 0) {
  564. size += 1 + pb::CodedOutputStream.ComputeStringSize(PivotName);
  565. }
  566. if (Branch != 0) {
  567. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Branch);
  568. }
  569. if (valuesDef_ != null) {
  570. size += 1 + pb::CodedOutputStream.ComputeMessageSize(ValuesDef);
  571. }
  572. size += nestedContexts_.CalculateSize(_repeated_nestedContexts_codec);
  573. if (_unknownFields != null) {
  574. size += _unknownFields.CalculateSize();
  575. }
  576. return size;
  577. }
  578. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  579. public void MergeFrom(CondContextDef other) {
  580. if (other == null) {
  581. return;
  582. }
  583. if (other.ContextName.Length != 0) {
  584. ContextName = other.ContextName;
  585. }
  586. if (other.PredName.Length != 0) {
  587. PredName = other.PredName;
  588. }
  589. if (other.PivotName.Length != 0) {
  590. PivotName = other.PivotName;
  591. }
  592. if (other.Branch != 0) {
  593. Branch = other.Branch;
  594. }
  595. if (other.valuesDef_ != null) {
  596. if (valuesDef_ == null) {
  597. valuesDef_ = new global::Tensorflow.ValuesDef();
  598. }
  599. ValuesDef.MergeFrom(other.ValuesDef);
  600. }
  601. nestedContexts_.Add(other.nestedContexts_);
  602. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  603. }
  604. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  605. public void MergeFrom(pb::CodedInputStream input) {
  606. uint tag;
  607. while ((tag = input.ReadTag()) != 0) {
  608. switch(tag) {
  609. default:
  610. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  611. break;
  612. case 10: {
  613. ContextName = input.ReadString();
  614. break;
  615. }
  616. case 18: {
  617. PredName = input.ReadString();
  618. break;
  619. }
  620. case 26: {
  621. PivotName = input.ReadString();
  622. break;
  623. }
  624. case 32: {
  625. Branch = input.ReadInt32();
  626. break;
  627. }
  628. case 42: {
  629. if (valuesDef_ == null) {
  630. valuesDef_ = new global::Tensorflow.ValuesDef();
  631. }
  632. input.ReadMessage(valuesDef_);
  633. break;
  634. }
  635. case 50: {
  636. nestedContexts_.AddEntriesFrom(input, _repeated_nestedContexts_codec);
  637. break;
  638. }
  639. }
  640. }
  641. }
  642. }
  643. /// <summary>
  644. /// Protocol buffer representing a WhileContext object.
  645. /// </summary>
  646. public sealed partial class WhileContextDef : pb::IMessage<WhileContextDef> {
  647. private static readonly pb::MessageParser<WhileContextDef> _parser = new pb::MessageParser<WhileContextDef>(() => new WhileContextDef());
  648. private pb::UnknownFieldSet _unknownFields;
  649. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  650. public static pb::MessageParser<WhileContextDef> Parser { get { return _parser; } }
  651. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  652. public static pbr::MessageDescriptor Descriptor {
  653. get { return global::Tensorflow.ControlFlowReflection.Descriptor.MessageTypes[3]; }
  654. }
  655. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  656. pbr::MessageDescriptor pb::IMessage.Descriptor {
  657. get { return Descriptor; }
  658. }
  659. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  660. public WhileContextDef() {
  661. OnConstruction();
  662. }
  663. partial void OnConstruction();
  664. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  665. public WhileContextDef(WhileContextDef other) : this() {
  666. contextName_ = other.contextName_;
  667. parallelIterations_ = other.parallelIterations_;
  668. backProp_ = other.backProp_;
  669. swapMemory_ = other.swapMemory_;
  670. pivotName_ = other.pivotName_;
  671. pivotForPredName_ = other.pivotForPredName_;
  672. pivotForBodyName_ = other.pivotForBodyName_;
  673. loopExitNames_ = other.loopExitNames_.Clone();
  674. loopEnterNames_ = other.loopEnterNames_.Clone();
  675. valuesDef_ = other.valuesDef_ != null ? other.valuesDef_.Clone() : null;
  676. maximumIterationsName_ = other.maximumIterationsName_;
  677. nestedContexts_ = other.nestedContexts_.Clone();
  678. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  679. }
  680. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  681. public WhileContextDef Clone() {
  682. return new WhileContextDef(this);
  683. }
  684. /// <summary>Field number for the "context_name" field.</summary>
  685. public const int ContextNameFieldNumber = 1;
  686. private string contextName_ = "";
  687. /// <summary>
  688. /// Name of the context.
  689. /// </summary>
  690. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  691. public string ContextName {
  692. get { return contextName_; }
  693. set {
  694. contextName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  695. }
  696. }
  697. /// <summary>Field number for the "parallel_iterations" field.</summary>
  698. public const int ParallelIterationsFieldNumber = 2;
  699. private int parallelIterations_;
  700. /// <summary>
  701. /// The number of iterations allowed to run in parallel.
  702. /// </summary>
  703. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  704. public int ParallelIterations {
  705. get { return parallelIterations_; }
  706. set {
  707. parallelIterations_ = value;
  708. }
  709. }
  710. /// <summary>Field number for the "back_prop" field.</summary>
  711. public const int BackPropFieldNumber = 3;
  712. private bool backProp_;
  713. /// <summary>
  714. /// Whether backprop is enabled for this while loop.
  715. /// </summary>
  716. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  717. public bool BackProp {
  718. get { return backProp_; }
  719. set {
  720. backProp_ = value;
  721. }
  722. }
  723. /// <summary>Field number for the "swap_memory" field.</summary>
  724. public const int SwapMemoryFieldNumber = 4;
  725. private bool swapMemory_;
  726. /// <summary>
  727. /// Whether GPU-CPU memory swap is enabled for this loop.
  728. /// </summary>
  729. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  730. public bool SwapMemory {
  731. get { return swapMemory_; }
  732. set {
  733. swapMemory_ = value;
  734. }
  735. }
  736. /// <summary>Field number for the "pivot_name" field.</summary>
  737. public const int PivotNameFieldNumber = 5;
  738. private string pivotName_ = "";
  739. /// <summary>
  740. /// Name of the pivot tensor.
  741. /// </summary>
  742. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  743. public string PivotName {
  744. get { return pivotName_; }
  745. set {
  746. pivotName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  747. }
  748. }
  749. /// <summary>Field number for the "pivot_for_pred_name" field.</summary>
  750. public const int PivotForPredNameFieldNumber = 6;
  751. private string pivotForPredName_ = "";
  752. /// <summary>
  753. /// Name of the pivot_for_pred tensor.
  754. /// </summary>
  755. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  756. public string PivotForPredName {
  757. get { return pivotForPredName_; }
  758. set {
  759. pivotForPredName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  760. }
  761. }
  762. /// <summary>Field number for the "pivot_for_body_name" field.</summary>
  763. public const int PivotForBodyNameFieldNumber = 7;
  764. private string pivotForBodyName_ = "";
  765. /// <summary>
  766. /// Name of the pivot_for_body tensor.
  767. /// </summary>
  768. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  769. public string PivotForBodyName {
  770. get { return pivotForBodyName_; }
  771. set {
  772. pivotForBodyName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  773. }
  774. }
  775. /// <summary>Field number for the "loop_exit_names" field.</summary>
  776. public const int LoopExitNamesFieldNumber = 8;
  777. private static readonly pb::FieldCodec<string> _repeated_loopExitNames_codec
  778. = pb::FieldCodec.ForString(66);
  779. private readonly pbc::RepeatedField<string> loopExitNames_ = new pbc::RepeatedField<string>();
  780. /// <summary>
  781. /// List of names for exit tensors.
  782. /// </summary>
  783. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  784. public pbc::RepeatedField<string> LoopExitNames {
  785. get { return loopExitNames_; }
  786. }
  787. /// <summary>Field number for the "loop_enter_names" field.</summary>
  788. public const int LoopEnterNamesFieldNumber = 10;
  789. private static readonly pb::FieldCodec<string> _repeated_loopEnterNames_codec
  790. = pb::FieldCodec.ForString(82);
  791. private readonly pbc::RepeatedField<string> loopEnterNames_ = new pbc::RepeatedField<string>();
  792. /// <summary>
  793. /// List of names for enter tensors.
  794. /// </summary>
  795. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  796. public pbc::RepeatedField<string> LoopEnterNames {
  797. get { return loopEnterNames_; }
  798. }
  799. /// <summary>Field number for the "values_def" field.</summary>
  800. public const int ValuesDefFieldNumber = 9;
  801. private global::Tensorflow.ValuesDef valuesDef_;
  802. /// <summary>
  803. /// Values and external values in control flow context.
  804. /// </summary>
  805. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  806. public global::Tensorflow.ValuesDef ValuesDef {
  807. get { return valuesDef_; }
  808. set {
  809. valuesDef_ = value;
  810. }
  811. }
  812. /// <summary>Field number for the "maximum_iterations_name" field.</summary>
  813. public const int MaximumIterationsNameFieldNumber = 11;
  814. private string maximumIterationsName_ = "";
  815. /// <summary>
  816. /// Optional name of the maximum_iterations tensor.
  817. /// </summary>
  818. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  819. public string MaximumIterationsName {
  820. get { return maximumIterationsName_; }
  821. set {
  822. maximumIterationsName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  823. }
  824. }
  825. /// <summary>Field number for the "nested_contexts" field.</summary>
  826. public const int NestedContextsFieldNumber = 12;
  827. private static readonly pb::FieldCodec<global::Tensorflow.ControlFlowContextDef> _repeated_nestedContexts_codec
  828. = pb::FieldCodec.ForMessage(98, global::Tensorflow.ControlFlowContextDef.Parser);
  829. private readonly pbc::RepeatedField<global::Tensorflow.ControlFlowContextDef> nestedContexts_ = new pbc::RepeatedField<global::Tensorflow.ControlFlowContextDef>();
  830. /// <summary>
  831. /// Contexts contained inside this context (e.g. nested whiles).
  832. /// </summary>
  833. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  834. public pbc::RepeatedField<global::Tensorflow.ControlFlowContextDef> NestedContexts {
  835. get { return nestedContexts_; }
  836. }
  837. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  838. public override bool Equals(object other) {
  839. return Equals(other as WhileContextDef);
  840. }
  841. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  842. public bool Equals(WhileContextDef other) {
  843. if (ReferenceEquals(other, null)) {
  844. return false;
  845. }
  846. if (ReferenceEquals(other, this)) {
  847. return true;
  848. }
  849. if (ContextName != other.ContextName) return false;
  850. if (ParallelIterations != other.ParallelIterations) return false;
  851. if (BackProp != other.BackProp) return false;
  852. if (SwapMemory != other.SwapMemory) return false;
  853. if (PivotName != other.PivotName) return false;
  854. if (PivotForPredName != other.PivotForPredName) return false;
  855. if (PivotForBodyName != other.PivotForBodyName) return false;
  856. if(!loopExitNames_.Equals(other.loopExitNames_)) return false;
  857. if(!loopEnterNames_.Equals(other.loopEnterNames_)) return false;
  858. if (!object.Equals(ValuesDef, other.ValuesDef)) return false;
  859. if (MaximumIterationsName != other.MaximumIterationsName) return false;
  860. if(!nestedContexts_.Equals(other.nestedContexts_)) return false;
  861. return Equals(_unknownFields, other._unknownFields);
  862. }
  863. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  864. public override int GetHashCode() {
  865. int hash = 1;
  866. if (ContextName.Length != 0) hash ^= ContextName.GetHashCode();
  867. if (ParallelIterations != 0) hash ^= ParallelIterations.GetHashCode();
  868. if (BackProp != false) hash ^= BackProp.GetHashCode();
  869. if (SwapMemory != false) hash ^= SwapMemory.GetHashCode();
  870. if (PivotName.Length != 0) hash ^= PivotName.GetHashCode();
  871. if (PivotForPredName.Length != 0) hash ^= PivotForPredName.GetHashCode();
  872. if (PivotForBodyName.Length != 0) hash ^= PivotForBodyName.GetHashCode();
  873. hash ^= loopExitNames_.GetHashCode();
  874. hash ^= loopEnterNames_.GetHashCode();
  875. if (valuesDef_ != null) hash ^= ValuesDef.GetHashCode();
  876. if (MaximumIterationsName.Length != 0) hash ^= MaximumIterationsName.GetHashCode();
  877. hash ^= nestedContexts_.GetHashCode();
  878. if (_unknownFields != null) {
  879. hash ^= _unknownFields.GetHashCode();
  880. }
  881. return hash;
  882. }
  883. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  884. public override string ToString() {
  885. return pb::JsonFormatter.ToDiagnosticString(this);
  886. }
  887. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  888. public void WriteTo(pb::CodedOutputStream output) {
  889. if (ContextName.Length != 0) {
  890. output.WriteRawTag(10);
  891. output.WriteString(ContextName);
  892. }
  893. if (ParallelIterations != 0) {
  894. output.WriteRawTag(16);
  895. output.WriteInt32(ParallelIterations);
  896. }
  897. if (BackProp != false) {
  898. output.WriteRawTag(24);
  899. output.WriteBool(BackProp);
  900. }
  901. if (SwapMemory != false) {
  902. output.WriteRawTag(32);
  903. output.WriteBool(SwapMemory);
  904. }
  905. if (PivotName.Length != 0) {
  906. output.WriteRawTag(42);
  907. output.WriteString(PivotName);
  908. }
  909. if (PivotForPredName.Length != 0) {
  910. output.WriteRawTag(50);
  911. output.WriteString(PivotForPredName);
  912. }
  913. if (PivotForBodyName.Length != 0) {
  914. output.WriteRawTag(58);
  915. output.WriteString(PivotForBodyName);
  916. }
  917. loopExitNames_.WriteTo(output, _repeated_loopExitNames_codec);
  918. if (valuesDef_ != null) {
  919. output.WriteRawTag(74);
  920. output.WriteMessage(ValuesDef);
  921. }
  922. loopEnterNames_.WriteTo(output, _repeated_loopEnterNames_codec);
  923. if (MaximumIterationsName.Length != 0) {
  924. output.WriteRawTag(90);
  925. output.WriteString(MaximumIterationsName);
  926. }
  927. nestedContexts_.WriteTo(output, _repeated_nestedContexts_codec);
  928. if (_unknownFields != null) {
  929. _unknownFields.WriteTo(output);
  930. }
  931. }
  932. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  933. public int CalculateSize() {
  934. int size = 0;
  935. if (ContextName.Length != 0) {
  936. size += 1 + pb::CodedOutputStream.ComputeStringSize(ContextName);
  937. }
  938. if (ParallelIterations != 0) {
  939. size += 1 + pb::CodedOutputStream.ComputeInt32Size(ParallelIterations);
  940. }
  941. if (BackProp != false) {
  942. size += 1 + 1;
  943. }
  944. if (SwapMemory != false) {
  945. size += 1 + 1;
  946. }
  947. if (PivotName.Length != 0) {
  948. size += 1 + pb::CodedOutputStream.ComputeStringSize(PivotName);
  949. }
  950. if (PivotForPredName.Length != 0) {
  951. size += 1 + pb::CodedOutputStream.ComputeStringSize(PivotForPredName);
  952. }
  953. if (PivotForBodyName.Length != 0) {
  954. size += 1 + pb::CodedOutputStream.ComputeStringSize(PivotForBodyName);
  955. }
  956. size += loopExitNames_.CalculateSize(_repeated_loopExitNames_codec);
  957. size += loopEnterNames_.CalculateSize(_repeated_loopEnterNames_codec);
  958. if (valuesDef_ != null) {
  959. size += 1 + pb::CodedOutputStream.ComputeMessageSize(ValuesDef);
  960. }
  961. if (MaximumIterationsName.Length != 0) {
  962. size += 1 + pb::CodedOutputStream.ComputeStringSize(MaximumIterationsName);
  963. }
  964. size += nestedContexts_.CalculateSize(_repeated_nestedContexts_codec);
  965. if (_unknownFields != null) {
  966. size += _unknownFields.CalculateSize();
  967. }
  968. return size;
  969. }
  970. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  971. public void MergeFrom(WhileContextDef other) {
  972. if (other == null) {
  973. return;
  974. }
  975. if (other.ContextName.Length != 0) {
  976. ContextName = other.ContextName;
  977. }
  978. if (other.ParallelIterations != 0) {
  979. ParallelIterations = other.ParallelIterations;
  980. }
  981. if (other.BackProp != false) {
  982. BackProp = other.BackProp;
  983. }
  984. if (other.SwapMemory != false) {
  985. SwapMemory = other.SwapMemory;
  986. }
  987. if (other.PivotName.Length != 0) {
  988. PivotName = other.PivotName;
  989. }
  990. if (other.PivotForPredName.Length != 0) {
  991. PivotForPredName = other.PivotForPredName;
  992. }
  993. if (other.PivotForBodyName.Length != 0) {
  994. PivotForBodyName = other.PivotForBodyName;
  995. }
  996. loopExitNames_.Add(other.loopExitNames_);
  997. loopEnterNames_.Add(other.loopEnterNames_);
  998. if (other.valuesDef_ != null) {
  999. if (valuesDef_ == null) {
  1000. valuesDef_ = new global::Tensorflow.ValuesDef();
  1001. }
  1002. ValuesDef.MergeFrom(other.ValuesDef);
  1003. }
  1004. if (other.MaximumIterationsName.Length != 0) {
  1005. MaximumIterationsName = other.MaximumIterationsName;
  1006. }
  1007. nestedContexts_.Add(other.nestedContexts_);
  1008. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1009. }
  1010. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1011. public void MergeFrom(pb::CodedInputStream input) {
  1012. uint tag;
  1013. while ((tag = input.ReadTag()) != 0) {
  1014. switch(tag) {
  1015. default:
  1016. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1017. break;
  1018. case 10: {
  1019. ContextName = input.ReadString();
  1020. break;
  1021. }
  1022. case 16: {
  1023. ParallelIterations = input.ReadInt32();
  1024. break;
  1025. }
  1026. case 24: {
  1027. BackProp = input.ReadBool();
  1028. break;
  1029. }
  1030. case 32: {
  1031. SwapMemory = input.ReadBool();
  1032. break;
  1033. }
  1034. case 42: {
  1035. PivotName = input.ReadString();
  1036. break;
  1037. }
  1038. case 50: {
  1039. PivotForPredName = input.ReadString();
  1040. break;
  1041. }
  1042. case 58: {
  1043. PivotForBodyName = input.ReadString();
  1044. break;
  1045. }
  1046. case 66: {
  1047. loopExitNames_.AddEntriesFrom(input, _repeated_loopExitNames_codec);
  1048. break;
  1049. }
  1050. case 74: {
  1051. if (valuesDef_ == null) {
  1052. valuesDef_ = new global::Tensorflow.ValuesDef();
  1053. }
  1054. input.ReadMessage(valuesDef_);
  1055. break;
  1056. }
  1057. case 82: {
  1058. loopEnterNames_.AddEntriesFrom(input, _repeated_loopEnterNames_codec);
  1059. break;
  1060. }
  1061. case 90: {
  1062. MaximumIterationsName = input.ReadString();
  1063. break;
  1064. }
  1065. case 98: {
  1066. nestedContexts_.AddEntriesFrom(input, _repeated_nestedContexts_codec);
  1067. break;
  1068. }
  1069. }
  1070. }
  1071. }
  1072. }
  1073. #endregion
  1074. }
  1075. #endregion Designer generated code

tensorflow框架的.NET版本,提供了丰富的特性和API,可以借此很方便地在.NET平台下搭建深度学习训练与推理流程。