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.

AttrValue.cs 38 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: tensorflow/core/framework/attr_value.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/framework/attr_value.proto</summary>
  13. public static partial class AttrValueReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for tensorflow/core/framework/attr_value.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static AttrValueReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "Cip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2F0dHJfdmFsdWUucHJvdG8S",
  24. "CnRlbnNvcmZsb3caJnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvdGVuc29y",
  25. "LnByb3RvGix0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNvcl9zaGFw",
  26. "ZS5wcm90bxoldGVuc29yZmxvdy9jb3JlL2ZyYW1ld29yay90eXBlcy5wcm90",
  27. "byKmBAoJQXR0clZhbHVlEgsKAXMYAiABKAxIABILCgFpGAMgASgDSAASCwoB",
  28. "ZhgEIAEoAkgAEgsKAWIYBSABKAhIABIkCgR0eXBlGAYgASgOMhQudGVuc29y",
  29. "Zmxvdy5EYXRhVHlwZUgAEi0KBXNoYXBlGAcgASgLMhwudGVuc29yZmxvdy5U",
  30. "ZW5zb3JTaGFwZVByb3RvSAASKQoGdGVuc29yGAggASgLMhcudGVuc29yZmxv",
  31. "dy5UZW5zb3JQcm90b0gAEi8KBGxpc3QYASABKAsyHy50ZW5zb3JmbG93LkF0",
  32. "dHJWYWx1ZS5MaXN0VmFsdWVIABIoCgRmdW5jGAogASgLMhgudGVuc29yZmxv",
  33. "dy5OYW1lQXR0ckxpc3RIABIVCgtwbGFjZWhvbGRlchgJIAEoCUgAGukBCglM",
  34. "aXN0VmFsdWUSCQoBcxgCIAMoDBINCgFpGAMgAygDQgIQARINCgFmGAQgAygC",
  35. "QgIQARINCgFiGAUgAygIQgIQARImCgR0eXBlGAYgAygOMhQudGVuc29yZmxv",
  36. "dy5EYXRhVHlwZUICEAESKwoFc2hhcGUYByADKAsyHC50ZW5zb3JmbG93LlRl",
  37. "bnNvclNoYXBlUHJvdG8SJwoGdGVuc29yGAggAygLMhcudGVuc29yZmxvdy5U",
  38. "ZW5zb3JQcm90bxImCgRmdW5jGAkgAygLMhgudGVuc29yZmxvdy5OYW1lQXR0",
  39. "ckxpc3RCBwoFdmFsdWUikgEKDE5hbWVBdHRyTGlzdBIMCgRuYW1lGAEgASgJ",
  40. "EjAKBGF0dHIYAiADKAsyIi50ZW5zb3JmbG93Lk5hbWVBdHRyTGlzdC5BdHRy",
  41. "RW50cnkaQgoJQXR0ckVudHJ5EgsKA2tleRgBIAEoCRIkCgV2YWx1ZRgCIAEo",
  42. "CzIVLnRlbnNvcmZsb3cuQXR0clZhbHVlOgI4AUJvChhvcmcudGVuc29yZmxv",
  43. "dy5mcmFtZXdvcmtCD0F0dHJWYWx1ZVByb3Rvc1ABWj1naXRodWIuY29tL3Rl",
  44. "bnNvcmZsb3cvdGVuc29yZmxvdy90ZW5zb3JmbG93L2dvL2NvcmUvZnJhbWV3",
  45. "b3Jr+AEBYgZwcm90bzM="));
  46. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  47. new pbr::FileDescriptor[] { global::Tensorflow.TensorReflection.Descriptor, global::Tensorflow.TensorShapeReflection.Descriptor, global::Tensorflow.TypesReflection.Descriptor, },
  48. new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
  49. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AttrValue), global::Tensorflow.AttrValue.Parser, new[]{ "S", "I", "F", "B", "Type", "Shape", "Tensor", "List", "Func", "Placeholder" }, new[]{ "Value" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AttrValue.Types.ListValue), global::Tensorflow.AttrValue.Types.ListValue.Parser, new[]{ "S", "I", "F", "B", "Type", "Shape", "Tensor", "Func" }, null, null, null, null)}),
  50. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.NameAttrList), global::Tensorflow.NameAttrList.Parser, new[]{ "Name", "Attr" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
  51. }));
  52. }
  53. #endregion
  54. }
  55. #region Messages
  56. /// <summary>
  57. /// Protocol buffer representing the value for an attr used to configure an Op.
  58. /// Comment indicates the corresponding attr type. Only the field matching the
  59. /// attr type may be filled.
  60. /// </summary>
  61. public sealed partial class AttrValue : pb::IMessage<AttrValue> {
  62. private static readonly pb::MessageParser<AttrValue> _parser = new pb::MessageParser<AttrValue>(() => new AttrValue());
  63. private pb::UnknownFieldSet _unknownFields;
  64. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  65. public static pb::MessageParser<AttrValue> Parser { get { return _parser; } }
  66. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  67. public static pbr::MessageDescriptor Descriptor {
  68. get { return global::Tensorflow.AttrValueReflection.Descriptor.MessageTypes[0]; }
  69. }
  70. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  71. pbr::MessageDescriptor pb::IMessage.Descriptor {
  72. get { return Descriptor; }
  73. }
  74. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  75. public AttrValue() {
  76. OnConstruction();
  77. }
  78. partial void OnConstruction();
  79. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  80. public AttrValue(AttrValue other) : this() {
  81. switch (other.ValueCase) {
  82. case ValueOneofCase.S:
  83. S = other.S;
  84. break;
  85. case ValueOneofCase.I:
  86. I = other.I;
  87. break;
  88. case ValueOneofCase.F:
  89. F = other.F;
  90. break;
  91. case ValueOneofCase.B:
  92. B = other.B;
  93. break;
  94. case ValueOneofCase.Type:
  95. Type = other.Type;
  96. break;
  97. case ValueOneofCase.Shape:
  98. Shape = other.Shape.Clone();
  99. break;
  100. case ValueOneofCase.Tensor:
  101. Tensor = other.Tensor.Clone();
  102. break;
  103. case ValueOneofCase.List:
  104. List = other.List.Clone();
  105. break;
  106. case ValueOneofCase.Func:
  107. Func = other.Func.Clone();
  108. break;
  109. case ValueOneofCase.Placeholder:
  110. Placeholder = other.Placeholder;
  111. break;
  112. }
  113. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  114. }
  115. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  116. public AttrValue Clone() {
  117. return new AttrValue(this);
  118. }
  119. /// <summary>Field number for the "s" field.</summary>
  120. public const int SFieldNumber = 2;
  121. /// <summary>
  122. /// "string"
  123. /// </summary>
  124. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  125. public pb::ByteString S {
  126. get { return valueCase_ == ValueOneofCase.S ? (pb::ByteString) value_ : pb::ByteString.Empty; }
  127. set {
  128. value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  129. valueCase_ = ValueOneofCase.S;
  130. }
  131. }
  132. /// <summary>Field number for the "i" field.</summary>
  133. public const int IFieldNumber = 3;
  134. /// <summary>
  135. /// "int"
  136. /// </summary>
  137. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  138. public long I {
  139. get { return valueCase_ == ValueOneofCase.I ? (long) value_ : 0L; }
  140. set {
  141. value_ = value;
  142. valueCase_ = ValueOneofCase.I;
  143. }
  144. }
  145. /// <summary>Field number for the "f" field.</summary>
  146. public const int FFieldNumber = 4;
  147. /// <summary>
  148. /// "float"
  149. /// </summary>
  150. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  151. public float F {
  152. get { return valueCase_ == ValueOneofCase.F ? (float) value_ : 0F; }
  153. set {
  154. value_ = value;
  155. valueCase_ = ValueOneofCase.F;
  156. }
  157. }
  158. /// <summary>Field number for the "b" field.</summary>
  159. public const int BFieldNumber = 5;
  160. /// <summary>
  161. /// "bool"
  162. /// </summary>
  163. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  164. public bool B {
  165. get { return valueCase_ == ValueOneofCase.B ? (bool) value_ : false; }
  166. set {
  167. value_ = value;
  168. valueCase_ = ValueOneofCase.B;
  169. }
  170. }
  171. /// <summary>Field number for the "type" field.</summary>
  172. public const int TypeFieldNumber = 6;
  173. /// <summary>
  174. /// "type"
  175. /// </summary>
  176. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  177. public global::Tensorflow.DataType Type {
  178. get { return valueCase_ == ValueOneofCase.Type ? (global::Tensorflow.DataType) value_ : global::Tensorflow.DataType.DtInvalid; }
  179. set {
  180. value_ = value;
  181. valueCase_ = ValueOneofCase.Type;
  182. }
  183. }
  184. /// <summary>Field number for the "shape" field.</summary>
  185. public const int ShapeFieldNumber = 7;
  186. /// <summary>
  187. /// "shape"
  188. /// </summary>
  189. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  190. public global::Tensorflow.TensorShapeProto Shape {
  191. get { return valueCase_ == ValueOneofCase.Shape ? (global::Tensorflow.TensorShapeProto) value_ : null; }
  192. set {
  193. value_ = value;
  194. valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.Shape;
  195. }
  196. }
  197. /// <summary>Field number for the "tensor" field.</summary>
  198. public const int TensorFieldNumber = 8;
  199. /// <summary>
  200. /// "tensor"
  201. /// </summary>
  202. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  203. public global::Tensorflow.TensorProto Tensor {
  204. get { return valueCase_ == ValueOneofCase.Tensor ? (global::Tensorflow.TensorProto) value_ : null; }
  205. set {
  206. value_ = value;
  207. valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.Tensor;
  208. }
  209. }
  210. /// <summary>Field number for the "list" field.</summary>
  211. public const int ListFieldNumber = 1;
  212. /// <summary>
  213. /// any "list(...)"
  214. /// </summary>
  215. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  216. public global::Tensorflow.AttrValue.Types.ListValue List {
  217. get { return valueCase_ == ValueOneofCase.List ? (global::Tensorflow.AttrValue.Types.ListValue) value_ : null; }
  218. set {
  219. value_ = value;
  220. valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.List;
  221. }
  222. }
  223. /// <summary>Field number for the "func" field.</summary>
  224. public const int FuncFieldNumber = 10;
  225. /// <summary>
  226. /// "func" represents a function. func.name is a function's name or
  227. /// a primitive op's name. func.attr.first is the name of an attr
  228. /// defined for that function. func.attr.second is the value for
  229. /// that attr in the instantiation.
  230. /// </summary>
  231. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  232. public global::Tensorflow.NameAttrList Func {
  233. get { return valueCase_ == ValueOneofCase.Func ? (global::Tensorflow.NameAttrList) value_ : null; }
  234. set {
  235. value_ = value;
  236. valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.Func;
  237. }
  238. }
  239. /// <summary>Field number for the "placeholder" field.</summary>
  240. public const int PlaceholderFieldNumber = 9;
  241. /// <summary>
  242. /// This is a placeholder only used in nodes defined inside a
  243. /// function. It indicates the attr value will be supplied when
  244. /// the function is instantiated. For example, let us suppose a
  245. /// node "N" in function "FN". "N" has an attr "A" with value
  246. /// placeholder = "foo". When FN is instantiated with attr "foo"
  247. /// set to "bar", the instantiated node N's attr A will have been
  248. /// given the value "bar".
  249. /// </summary>
  250. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  251. public string Placeholder {
  252. get { return valueCase_ == ValueOneofCase.Placeholder ? (string) value_ : ""; }
  253. set {
  254. value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  255. valueCase_ = ValueOneofCase.Placeholder;
  256. }
  257. }
  258. private object value_;
  259. /// <summary>Enum of possible cases for the "value" oneof.</summary>
  260. public enum ValueOneofCase {
  261. None = 0,
  262. S = 2,
  263. I = 3,
  264. F = 4,
  265. B = 5,
  266. Type = 6,
  267. Shape = 7,
  268. Tensor = 8,
  269. List = 1,
  270. Func = 10,
  271. Placeholder = 9,
  272. }
  273. private ValueOneofCase valueCase_ = ValueOneofCase.None;
  274. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  275. public ValueOneofCase ValueCase {
  276. get { return valueCase_; }
  277. }
  278. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  279. public void ClearValue() {
  280. valueCase_ = ValueOneofCase.None;
  281. value_ = null;
  282. }
  283. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  284. public override bool Equals(object other) {
  285. return Equals(other as AttrValue);
  286. }
  287. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  288. public bool Equals(AttrValue other) {
  289. if (ReferenceEquals(other, null)) {
  290. return false;
  291. }
  292. if (ReferenceEquals(other, this)) {
  293. return true;
  294. }
  295. if (S != other.S) return false;
  296. if (I != other.I) return false;
  297. if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(F, other.F)) return false;
  298. if (B != other.B) return false;
  299. if (Type != other.Type) return false;
  300. if (!object.Equals(Shape, other.Shape)) return false;
  301. if (!object.Equals(Tensor, other.Tensor)) return false;
  302. if (!object.Equals(List, other.List)) return false;
  303. if (!object.Equals(Func, other.Func)) return false;
  304. if (Placeholder != other.Placeholder) return false;
  305. if (ValueCase != other.ValueCase) return false;
  306. return Equals(_unknownFields, other._unknownFields);
  307. }
  308. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  309. public override int GetHashCode() {
  310. int hash = 1;
  311. if (valueCase_ == ValueOneofCase.S) hash ^= S.GetHashCode();
  312. if (valueCase_ == ValueOneofCase.I) hash ^= I.GetHashCode();
  313. if (valueCase_ == ValueOneofCase.F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(F);
  314. if (valueCase_ == ValueOneofCase.B) hash ^= B.GetHashCode();
  315. if (valueCase_ == ValueOneofCase.Type) hash ^= Type.GetHashCode();
  316. if (valueCase_ == ValueOneofCase.Shape) hash ^= Shape.GetHashCode();
  317. if (valueCase_ == ValueOneofCase.Tensor) hash ^= Tensor.GetHashCode();
  318. if (valueCase_ == ValueOneofCase.List) hash ^= List.GetHashCode();
  319. if (valueCase_ == ValueOneofCase.Func) hash ^= Func.GetHashCode();
  320. if (valueCase_ == ValueOneofCase.Placeholder) hash ^= Placeholder.GetHashCode();
  321. hash ^= (int) valueCase_;
  322. if (_unknownFields != null) {
  323. hash ^= _unknownFields.GetHashCode();
  324. }
  325. return hash;
  326. }
  327. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  328. public override string ToString() {
  329. return pb::JsonFormatter.ToDiagnosticString(this);
  330. }
  331. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  332. public void WriteTo(pb::CodedOutputStream output) {
  333. if (valueCase_ == ValueOneofCase.List) {
  334. output.WriteRawTag(10);
  335. output.WriteMessage(List);
  336. }
  337. if (valueCase_ == ValueOneofCase.S) {
  338. output.WriteRawTag(18);
  339. output.WriteBytes(S);
  340. }
  341. if (valueCase_ == ValueOneofCase.I) {
  342. output.WriteRawTag(24);
  343. output.WriteInt64(I);
  344. }
  345. if (valueCase_ == ValueOneofCase.F) {
  346. output.WriteRawTag(37);
  347. output.WriteFloat(F);
  348. }
  349. if (valueCase_ == ValueOneofCase.B) {
  350. output.WriteRawTag(40);
  351. output.WriteBool(B);
  352. }
  353. if (valueCase_ == ValueOneofCase.Type) {
  354. output.WriteRawTag(48);
  355. output.WriteEnum((int) Type);
  356. }
  357. if (valueCase_ == ValueOneofCase.Shape) {
  358. output.WriteRawTag(58);
  359. output.WriteMessage(Shape);
  360. }
  361. if (valueCase_ == ValueOneofCase.Tensor) {
  362. output.WriteRawTag(66);
  363. output.WriteMessage(Tensor);
  364. }
  365. if (valueCase_ == ValueOneofCase.Placeholder) {
  366. output.WriteRawTag(74);
  367. output.WriteString(Placeholder);
  368. }
  369. if (valueCase_ == ValueOneofCase.Func) {
  370. output.WriteRawTag(82);
  371. output.WriteMessage(Func);
  372. }
  373. if (_unknownFields != null) {
  374. _unknownFields.WriteTo(output);
  375. }
  376. }
  377. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  378. public int CalculateSize() {
  379. int size = 0;
  380. if (valueCase_ == ValueOneofCase.S) {
  381. size += 1 + pb::CodedOutputStream.ComputeBytesSize(S);
  382. }
  383. if (valueCase_ == ValueOneofCase.I) {
  384. size += 1 + pb::CodedOutputStream.ComputeInt64Size(I);
  385. }
  386. if (valueCase_ == ValueOneofCase.F) {
  387. size += 1 + 4;
  388. }
  389. if (valueCase_ == ValueOneofCase.B) {
  390. size += 1 + 1;
  391. }
  392. if (valueCase_ == ValueOneofCase.Type) {
  393. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
  394. }
  395. if (valueCase_ == ValueOneofCase.Shape) {
  396. size += 1 + pb::CodedOutputStream.ComputeMessageSize(Shape);
  397. }
  398. if (valueCase_ == ValueOneofCase.Tensor) {
  399. size += 1 + pb::CodedOutputStream.ComputeMessageSize(Tensor);
  400. }
  401. if (valueCase_ == ValueOneofCase.List) {
  402. size += 1 + pb::CodedOutputStream.ComputeMessageSize(List);
  403. }
  404. if (valueCase_ == ValueOneofCase.Func) {
  405. size += 1 + pb::CodedOutputStream.ComputeMessageSize(Func);
  406. }
  407. if (valueCase_ == ValueOneofCase.Placeholder) {
  408. size += 1 + pb::CodedOutputStream.ComputeStringSize(Placeholder);
  409. }
  410. if (_unknownFields != null) {
  411. size += _unknownFields.CalculateSize();
  412. }
  413. return size;
  414. }
  415. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  416. public void MergeFrom(AttrValue other) {
  417. if (other == null) {
  418. return;
  419. }
  420. switch (other.ValueCase) {
  421. case ValueOneofCase.S:
  422. S = other.S;
  423. break;
  424. case ValueOneofCase.I:
  425. I = other.I;
  426. break;
  427. case ValueOneofCase.F:
  428. F = other.F;
  429. break;
  430. case ValueOneofCase.B:
  431. B = other.B;
  432. break;
  433. case ValueOneofCase.Type:
  434. Type = other.Type;
  435. break;
  436. case ValueOneofCase.Shape:
  437. if (Shape == null) {
  438. Shape = new global::Tensorflow.TensorShapeProto();
  439. }
  440. Shape.MergeFrom(other.Shape);
  441. break;
  442. case ValueOneofCase.Tensor:
  443. if (Tensor == null) {
  444. Tensor = new global::Tensorflow.TensorProto();
  445. }
  446. Tensor.MergeFrom(other.Tensor);
  447. break;
  448. case ValueOneofCase.List:
  449. if (List == null) {
  450. List = new global::Tensorflow.AttrValue.Types.ListValue();
  451. }
  452. List.MergeFrom(other.List);
  453. break;
  454. case ValueOneofCase.Func:
  455. if (Func == null) {
  456. Func = new global::Tensorflow.NameAttrList();
  457. }
  458. Func.MergeFrom(other.Func);
  459. break;
  460. case ValueOneofCase.Placeholder:
  461. Placeholder = other.Placeholder;
  462. break;
  463. }
  464. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  465. }
  466. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  467. public void MergeFrom(pb::CodedInputStream input) {
  468. uint tag;
  469. while ((tag = input.ReadTag()) != 0) {
  470. switch(tag) {
  471. default:
  472. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  473. break;
  474. case 10: {
  475. global::Tensorflow.AttrValue.Types.ListValue subBuilder = new global::Tensorflow.AttrValue.Types.ListValue();
  476. if (valueCase_ == ValueOneofCase.List) {
  477. subBuilder.MergeFrom(List);
  478. }
  479. input.ReadMessage(subBuilder);
  480. List = subBuilder;
  481. break;
  482. }
  483. case 18: {
  484. S = input.ReadBytes();
  485. break;
  486. }
  487. case 24: {
  488. I = input.ReadInt64();
  489. break;
  490. }
  491. case 37: {
  492. F = input.ReadFloat();
  493. break;
  494. }
  495. case 40: {
  496. B = input.ReadBool();
  497. break;
  498. }
  499. case 48: {
  500. value_ = input.ReadEnum();
  501. valueCase_ = ValueOneofCase.Type;
  502. break;
  503. }
  504. case 58: {
  505. global::Tensorflow.TensorShapeProto subBuilder = new global::Tensorflow.TensorShapeProto();
  506. if (valueCase_ == ValueOneofCase.Shape) {
  507. subBuilder.MergeFrom(Shape);
  508. }
  509. input.ReadMessage(subBuilder);
  510. Shape = subBuilder;
  511. break;
  512. }
  513. case 66: {
  514. global::Tensorflow.TensorProto subBuilder = new global::Tensorflow.TensorProto();
  515. if (valueCase_ == ValueOneofCase.Tensor) {
  516. subBuilder.MergeFrom(Tensor);
  517. }
  518. input.ReadMessage(subBuilder);
  519. Tensor = subBuilder;
  520. break;
  521. }
  522. case 74: {
  523. Placeholder = input.ReadString();
  524. break;
  525. }
  526. case 82: {
  527. global::Tensorflow.NameAttrList subBuilder = new global::Tensorflow.NameAttrList();
  528. if (valueCase_ == ValueOneofCase.Func) {
  529. subBuilder.MergeFrom(Func);
  530. }
  531. input.ReadMessage(subBuilder);
  532. Func = subBuilder;
  533. break;
  534. }
  535. }
  536. }
  537. }
  538. #region Nested types
  539. /// <summary>Container for nested types declared in the AttrValue message type.</summary>
  540. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  541. public static partial class Types {
  542. /// <summary>
  543. /// LINT.IfChange
  544. /// </summary>
  545. public sealed partial class ListValue : pb::IMessage<ListValue> {
  546. private static readonly pb::MessageParser<ListValue> _parser = new pb::MessageParser<ListValue>(() => new ListValue());
  547. private pb::UnknownFieldSet _unknownFields;
  548. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  549. public static pb::MessageParser<ListValue> Parser { get { return _parser; } }
  550. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  551. public static pbr::MessageDescriptor Descriptor {
  552. get { return global::Tensorflow.AttrValue.Descriptor.NestedTypes[0]; }
  553. }
  554. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  555. pbr::MessageDescriptor pb::IMessage.Descriptor {
  556. get { return Descriptor; }
  557. }
  558. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  559. public ListValue() {
  560. OnConstruction();
  561. }
  562. partial void OnConstruction();
  563. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  564. public ListValue(ListValue other) : this() {
  565. s_ = other.s_.Clone();
  566. i_ = other.i_.Clone();
  567. f_ = other.f_.Clone();
  568. b_ = other.b_.Clone();
  569. type_ = other.type_.Clone();
  570. shape_ = other.shape_.Clone();
  571. tensor_ = other.tensor_.Clone();
  572. func_ = other.func_.Clone();
  573. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  574. }
  575. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  576. public ListValue Clone() {
  577. return new ListValue(this);
  578. }
  579. /// <summary>Field number for the "s" field.</summary>
  580. public const int SFieldNumber = 2;
  581. private static readonly pb::FieldCodec<pb::ByteString> _repeated_s_codec
  582. = pb::FieldCodec.ForBytes(18);
  583. private readonly pbc::RepeatedField<pb::ByteString> s_ = new pbc::RepeatedField<pb::ByteString>();
  584. /// <summary>
  585. /// "list(string)"
  586. /// </summary>
  587. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  588. public pbc::RepeatedField<pb::ByteString> S {
  589. get { return s_; }
  590. }
  591. /// <summary>Field number for the "i" field.</summary>
  592. public const int IFieldNumber = 3;
  593. private static readonly pb::FieldCodec<long> _repeated_i_codec
  594. = pb::FieldCodec.ForInt64(26);
  595. private readonly pbc::RepeatedField<long> i_ = new pbc::RepeatedField<long>();
  596. /// <summary>
  597. /// "list(int)"
  598. /// </summary>
  599. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  600. public pbc::RepeatedField<long> I {
  601. get { return i_; }
  602. }
  603. /// <summary>Field number for the "f" field.</summary>
  604. public const int FFieldNumber = 4;
  605. private static readonly pb::FieldCodec<float> _repeated_f_codec
  606. = pb::FieldCodec.ForFloat(34);
  607. private readonly pbc::RepeatedField<float> f_ = new pbc::RepeatedField<float>();
  608. /// <summary>
  609. /// "list(float)"
  610. /// </summary>
  611. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  612. public pbc::RepeatedField<float> F {
  613. get { return f_; }
  614. }
  615. /// <summary>Field number for the "b" field.</summary>
  616. public const int BFieldNumber = 5;
  617. private static readonly pb::FieldCodec<bool> _repeated_b_codec
  618. = pb::FieldCodec.ForBool(42);
  619. private readonly pbc::RepeatedField<bool> b_ = new pbc::RepeatedField<bool>();
  620. /// <summary>
  621. /// "list(bool)"
  622. /// </summary>
  623. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  624. public pbc::RepeatedField<bool> B {
  625. get { return b_; }
  626. }
  627. /// <summary>Field number for the "type" field.</summary>
  628. public const int TypeFieldNumber = 6;
  629. private static readonly pb::FieldCodec<global::Tensorflow.DataType> _repeated_type_codec
  630. = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::Tensorflow.DataType) x);
  631. private readonly pbc::RepeatedField<global::Tensorflow.DataType> type_ = new pbc::RepeatedField<global::Tensorflow.DataType>();
  632. /// <summary>
  633. /// "list(type)"
  634. /// </summary>
  635. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  636. public pbc::RepeatedField<global::Tensorflow.DataType> Type {
  637. get { return type_; }
  638. }
  639. /// <summary>Field number for the "shape" field.</summary>
  640. public const int ShapeFieldNumber = 7;
  641. private static readonly pb::FieldCodec<global::Tensorflow.TensorShapeProto> _repeated_shape_codec
  642. = pb::FieldCodec.ForMessage(58, global::Tensorflow.TensorShapeProto.Parser);
  643. private readonly pbc::RepeatedField<global::Tensorflow.TensorShapeProto> shape_ = new pbc::RepeatedField<global::Tensorflow.TensorShapeProto>();
  644. /// <summary>
  645. /// "list(shape)"
  646. /// </summary>
  647. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  648. public pbc::RepeatedField<global::Tensorflow.TensorShapeProto> Shape {
  649. get { return shape_; }
  650. }
  651. /// <summary>Field number for the "tensor" field.</summary>
  652. public const int TensorFieldNumber = 8;
  653. private static readonly pb::FieldCodec<global::Tensorflow.TensorProto> _repeated_tensor_codec
  654. = pb::FieldCodec.ForMessage(66, global::Tensorflow.TensorProto.Parser);
  655. private readonly pbc::RepeatedField<global::Tensorflow.TensorProto> tensor_ = new pbc::RepeatedField<global::Tensorflow.TensorProto>();
  656. /// <summary>
  657. /// "list(tensor)"
  658. /// </summary>
  659. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  660. public pbc::RepeatedField<global::Tensorflow.TensorProto> Tensor {
  661. get { return tensor_; }
  662. }
  663. /// <summary>Field number for the "func" field.</summary>
  664. public const int FuncFieldNumber = 9;
  665. private static readonly pb::FieldCodec<global::Tensorflow.NameAttrList> _repeated_func_codec
  666. = pb::FieldCodec.ForMessage(74, global::Tensorflow.NameAttrList.Parser);
  667. private readonly pbc::RepeatedField<global::Tensorflow.NameAttrList> func_ = new pbc::RepeatedField<global::Tensorflow.NameAttrList>();
  668. /// <summary>
  669. /// "list(attr)"
  670. /// </summary>
  671. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  672. public pbc::RepeatedField<global::Tensorflow.NameAttrList> Func {
  673. get { return func_; }
  674. }
  675. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  676. public override bool Equals(object other) {
  677. return Equals(other as ListValue);
  678. }
  679. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  680. public bool Equals(ListValue other) {
  681. if (ReferenceEquals(other, null)) {
  682. return false;
  683. }
  684. if (ReferenceEquals(other, this)) {
  685. return true;
  686. }
  687. if(!s_.Equals(other.s_)) return false;
  688. if(!i_.Equals(other.i_)) return false;
  689. if(!f_.Equals(other.f_)) return false;
  690. if(!b_.Equals(other.b_)) return false;
  691. if(!type_.Equals(other.type_)) return false;
  692. if(!shape_.Equals(other.shape_)) return false;
  693. if(!tensor_.Equals(other.tensor_)) return false;
  694. if(!func_.Equals(other.func_)) return false;
  695. return Equals(_unknownFields, other._unknownFields);
  696. }
  697. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  698. public override int GetHashCode() {
  699. int hash = 1;
  700. hash ^= s_.GetHashCode();
  701. hash ^= i_.GetHashCode();
  702. hash ^= f_.GetHashCode();
  703. hash ^= b_.GetHashCode();
  704. hash ^= type_.GetHashCode();
  705. hash ^= shape_.GetHashCode();
  706. hash ^= tensor_.GetHashCode();
  707. hash ^= func_.GetHashCode();
  708. if (_unknownFields != null) {
  709. hash ^= _unknownFields.GetHashCode();
  710. }
  711. return hash;
  712. }
  713. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  714. public override string ToString() {
  715. return pb::JsonFormatter.ToDiagnosticString(this);
  716. }
  717. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  718. public void WriteTo(pb::CodedOutputStream output) {
  719. s_.WriteTo(output, _repeated_s_codec);
  720. i_.WriteTo(output, _repeated_i_codec);
  721. f_.WriteTo(output, _repeated_f_codec);
  722. b_.WriteTo(output, _repeated_b_codec);
  723. type_.WriteTo(output, _repeated_type_codec);
  724. shape_.WriteTo(output, _repeated_shape_codec);
  725. tensor_.WriteTo(output, _repeated_tensor_codec);
  726. func_.WriteTo(output, _repeated_func_codec);
  727. if (_unknownFields != null) {
  728. _unknownFields.WriteTo(output);
  729. }
  730. }
  731. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  732. public int CalculateSize() {
  733. int size = 0;
  734. size += s_.CalculateSize(_repeated_s_codec);
  735. size += i_.CalculateSize(_repeated_i_codec);
  736. size += f_.CalculateSize(_repeated_f_codec);
  737. size += b_.CalculateSize(_repeated_b_codec);
  738. size += type_.CalculateSize(_repeated_type_codec);
  739. size += shape_.CalculateSize(_repeated_shape_codec);
  740. size += tensor_.CalculateSize(_repeated_tensor_codec);
  741. size += func_.CalculateSize(_repeated_func_codec);
  742. if (_unknownFields != null) {
  743. size += _unknownFields.CalculateSize();
  744. }
  745. return size;
  746. }
  747. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  748. public void MergeFrom(ListValue other) {
  749. if (other == null) {
  750. return;
  751. }
  752. s_.Add(other.s_);
  753. i_.Add(other.i_);
  754. f_.Add(other.f_);
  755. b_.Add(other.b_);
  756. type_.Add(other.type_);
  757. shape_.Add(other.shape_);
  758. tensor_.Add(other.tensor_);
  759. func_.Add(other.func_);
  760. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  761. }
  762. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  763. public void MergeFrom(pb::CodedInputStream input) {
  764. uint tag;
  765. while ((tag = input.ReadTag()) != 0) {
  766. switch(tag) {
  767. default:
  768. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  769. break;
  770. case 18: {
  771. s_.AddEntriesFrom(input, _repeated_s_codec);
  772. break;
  773. }
  774. case 26:
  775. case 24: {
  776. i_.AddEntriesFrom(input, _repeated_i_codec);
  777. break;
  778. }
  779. case 34:
  780. case 37: {
  781. f_.AddEntriesFrom(input, _repeated_f_codec);
  782. break;
  783. }
  784. case 42:
  785. case 40: {
  786. b_.AddEntriesFrom(input, _repeated_b_codec);
  787. break;
  788. }
  789. case 50:
  790. case 48: {
  791. type_.AddEntriesFrom(input, _repeated_type_codec);
  792. break;
  793. }
  794. case 58: {
  795. shape_.AddEntriesFrom(input, _repeated_shape_codec);
  796. break;
  797. }
  798. case 66: {
  799. tensor_.AddEntriesFrom(input, _repeated_tensor_codec);
  800. break;
  801. }
  802. case 74: {
  803. func_.AddEntriesFrom(input, _repeated_func_codec);
  804. break;
  805. }
  806. }
  807. }
  808. }
  809. }
  810. }
  811. #endregion
  812. }
  813. /// <summary>
  814. /// A list of attr names and their values. The whole list is attached
  815. /// with a string name. E.g., MatMul[T=float].
  816. /// </summary>
  817. public sealed partial class NameAttrList : pb::IMessage<NameAttrList> {
  818. private static readonly pb::MessageParser<NameAttrList> _parser = new pb::MessageParser<NameAttrList>(() => new NameAttrList());
  819. private pb::UnknownFieldSet _unknownFields;
  820. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  821. public static pb::MessageParser<NameAttrList> Parser { get { return _parser; } }
  822. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  823. public static pbr::MessageDescriptor Descriptor {
  824. get { return global::Tensorflow.AttrValueReflection.Descriptor.MessageTypes[1]; }
  825. }
  826. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  827. pbr::MessageDescriptor pb::IMessage.Descriptor {
  828. get { return Descriptor; }
  829. }
  830. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  831. public NameAttrList() {
  832. OnConstruction();
  833. }
  834. partial void OnConstruction();
  835. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  836. public NameAttrList(NameAttrList other) : this() {
  837. name_ = other.name_;
  838. attr_ = other.attr_.Clone();
  839. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  840. }
  841. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  842. public NameAttrList Clone() {
  843. return new NameAttrList(this);
  844. }
  845. /// <summary>Field number for the "name" field.</summary>
  846. public const int NameFieldNumber = 1;
  847. private string name_ = "";
  848. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  849. public string Name {
  850. get { return name_; }
  851. set {
  852. name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  853. }
  854. }
  855. /// <summary>Field number for the "attr" field.</summary>
  856. public const int AttrFieldNumber = 2;
  857. private static readonly pbc::MapField<string, global::Tensorflow.AttrValue>.Codec _map_attr_codec
  858. = new pbc::MapField<string, global::Tensorflow.AttrValue>.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Tensorflow.AttrValue.Parser), 18);
  859. private readonly pbc::MapField<string, global::Tensorflow.AttrValue> attr_ = new pbc::MapField<string, global::Tensorflow.AttrValue>();
  860. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  861. public pbc::MapField<string, global::Tensorflow.AttrValue> Attr {
  862. get { return attr_; }
  863. }
  864. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  865. public override bool Equals(object other) {
  866. return Equals(other as NameAttrList);
  867. }
  868. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  869. public bool Equals(NameAttrList other) {
  870. if (ReferenceEquals(other, null)) {
  871. return false;
  872. }
  873. if (ReferenceEquals(other, this)) {
  874. return true;
  875. }
  876. if (Name != other.Name) return false;
  877. if (!Attr.Equals(other.Attr)) return false;
  878. return Equals(_unknownFields, other._unknownFields);
  879. }
  880. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  881. public override int GetHashCode() {
  882. int hash = 1;
  883. if (Name.Length != 0) hash ^= Name.GetHashCode();
  884. hash ^= Attr.GetHashCode();
  885. if (_unknownFields != null) {
  886. hash ^= _unknownFields.GetHashCode();
  887. }
  888. return hash;
  889. }
  890. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  891. public override string ToString() {
  892. return pb::JsonFormatter.ToDiagnosticString(this);
  893. }
  894. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  895. public void WriteTo(pb::CodedOutputStream output) {
  896. if (Name.Length != 0) {
  897. output.WriteRawTag(10);
  898. output.WriteString(Name);
  899. }
  900. attr_.WriteTo(output, _map_attr_codec);
  901. if (_unknownFields != null) {
  902. _unknownFields.WriteTo(output);
  903. }
  904. }
  905. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  906. public int CalculateSize() {
  907. int size = 0;
  908. if (Name.Length != 0) {
  909. size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
  910. }
  911. size += attr_.CalculateSize(_map_attr_codec);
  912. if (_unknownFields != null) {
  913. size += _unknownFields.CalculateSize();
  914. }
  915. return size;
  916. }
  917. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  918. public void MergeFrom(NameAttrList other) {
  919. if (other == null) {
  920. return;
  921. }
  922. if (other.Name.Length != 0) {
  923. Name = other.Name;
  924. }
  925. attr_.Add(other.attr_);
  926. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  927. }
  928. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  929. public void MergeFrom(pb::CodedInputStream input) {
  930. uint tag;
  931. while ((tag = input.ReadTag()) != 0) {
  932. switch(tag) {
  933. default:
  934. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  935. break;
  936. case 10: {
  937. Name = input.ReadString();
  938. break;
  939. }
  940. case 18: {
  941. attr_.AddEntriesFrom(input, _map_attr_codec);
  942. break;
  943. }
  944. }
  945. }
  946. }
  947. }
  948. #endregion
  949. }
  950. #endregion Designer generated code