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.

Function.cs 56 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: tensorflow/core/framework/function.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021, 8981
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace Tensorflow {
  12. /// <summary>Holder for reflection information generated from tensorflow/core/framework/function.proto</summary>
  13. public static partial class FunctionReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for tensorflow/core/framework/function.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static FunctionReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "Cih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2Z1bmN0aW9uLnByb3RvEgp0",
  24. "ZW5zb3JmbG93Gip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2F0dHJfdmFs",
  25. "dWUucHJvdG8aKHRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvbm9kZV9kZWYu",
  26. "cHJvdG8aJnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvb3BfZGVmLnByb3Rv",
  27. "IqgBChJGdW5jdGlvbkRlZkxpYnJhcnkSKQoIZnVuY3Rpb24YASADKAsyFy50",
  28. "ZW5zb3JmbG93LkZ1bmN0aW9uRGVmEikKCGdyYWRpZW50GAIgAygLMhcudGVu",
  29. "c29yZmxvdy5HcmFkaWVudERlZhI8ChRyZWdpc3RlcmVkX2dyYWRpZW50cxgD",
  30. "IAMoCzIeLnRlbnNvcmZsb3cuUmVnaXN0ZXJlZEdyYWRpZW50IsQGCgtGdW5j",
  31. "dGlvbkRlZhIkCglzaWduYXR1cmUYASABKAsyES50ZW5zb3JmbG93Lk9wRGVm",
  32. "Ei8KBGF0dHIYBSADKAsyIS50ZW5zb3JmbG93LkZ1bmN0aW9uRGVmLkF0dHJF",
  33. "bnRyeRI2CghhcmdfYXR0chgHIAMoCzIkLnRlbnNvcmZsb3cuRnVuY3Rpb25E",
  34. "ZWYuQXJnQXR0ckVudHJ5ElAKFnJlc291cmNlX2FyZ191bmlxdWVfaWQYCCAD",
  35. "KAsyMC50ZW5zb3JmbG93LkZ1bmN0aW9uRGVmLlJlc291cmNlQXJnVW5pcXVl",
  36. "SWRFbnRyeRIlCghub2RlX2RlZhgDIAMoCzITLnRlbnNvcmZsb3cuTm9kZURl",
  37. "ZhItCgNyZXQYBCADKAsyIC50ZW5zb3JmbG93LkZ1bmN0aW9uRGVmLlJldEVu",
  38. "dHJ5EjwKC2NvbnRyb2xfcmV0GAYgAygLMicudGVuc29yZmxvdy5GdW5jdGlv",
  39. "bkRlZi5Db250cm9sUmV0RW50cnkaQgoJQXR0ckVudHJ5EgsKA2tleRgBIAEo",
  40. "CRIkCgV2YWx1ZRgCIAEoCzIVLnRlbnNvcmZsb3cuQXR0clZhbHVlOgI4ARqI",
  41. "AQoIQXJnQXR0cnMSOAoEYXR0chgBIAMoCzIqLnRlbnNvcmZsb3cuRnVuY3Rp",
  42. "b25EZWYuQXJnQXR0cnMuQXR0ckVudHJ5GkIKCUF0dHJFbnRyeRILCgNrZXkY",
  43. "ASABKAkSJAoFdmFsdWUYAiABKAsyFS50ZW5zb3JmbG93LkF0dHJWYWx1ZToC",
  44. "OAEaUAoMQXJnQXR0ckVudHJ5EgsKA2tleRgBIAEoDRIvCgV2YWx1ZRgCIAEo",
  45. "CzIgLnRlbnNvcmZsb3cuRnVuY3Rpb25EZWYuQXJnQXR0cnM6AjgBGjoKGFJl",
  46. "c291cmNlQXJnVW5pcXVlSWRFbnRyeRILCgNrZXkYASABKA0SDQoFdmFsdWUY",
  47. "AiABKA06AjgBGioKCFJldEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgC",
  48. "IAEoCToCOAEaMQoPQ29udHJvbFJldEVudHJ5EgsKA2tleRgBIAEoCRINCgV2",
  49. "YWx1ZRgCIAEoCToCOAFKBAgCEAMiOwoLR3JhZGllbnREZWYSFQoNZnVuY3Rp",
  50. "b25fbmFtZRgBIAEoCRIVCg1ncmFkaWVudF9mdW5jGAIgASgJIkcKElJlZ2lz",
  51. "dGVyZWRHcmFkaWVudBIVCg1ncmFkaWVudF9mdW5jGAEgASgJEhoKEnJlZ2lz",
  52. "dGVyZWRfb3BfdHlwZRgCIAEoCUKAAQoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3",
  53. "b3JrQg5GdW5jdGlvblByb3Rvc1ABWk9naXRodWIuY29tL3RlbnNvcmZsb3cv",
  54. "dGVuc29yZmxvdy90ZW5zb3JmbG93L2dvL2NvcmUvZnJhbWV3b3JrL2Z1bmN0",
  55. "aW9uX2dvX3Byb3Rv+AEBYgZwcm90bzM="));
  56. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  57. new pbr::FileDescriptor[] { global::Tensorflow.AttrValueReflection.Descriptor, global::Tensorflow.NodeDefReflection.Descriptor, global::Tensorflow.OpDefReflection.Descriptor, },
  58. new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
  59. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.FunctionDefLibrary), global::Tensorflow.FunctionDefLibrary.Parser, new[]{ "Function", "Gradient", "RegisteredGradients" }, null, null, null, null),
  60. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.FunctionDef), global::Tensorflow.FunctionDef.Parser, new[]{ "Signature", "Attr", "ArgAttr", "ResourceArgUniqueId", "NodeDef", "Ret", "ControlRet" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.FunctionDef.Types.ArgAttrs), global::Tensorflow.FunctionDef.Types.ArgAttrs.Parser, new[]{ "Attr" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
  61. null, null, null, null, }),
  62. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GradientDef), global::Tensorflow.GradientDef.Parser, new[]{ "FunctionName", "GradientFunc" }, null, null, null, null),
  63. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.RegisteredGradient), global::Tensorflow.RegisteredGradient.Parser, new[]{ "GradientFunc", "RegisteredOpType" }, null, null, null, null)
  64. }));
  65. }
  66. #endregion
  67. }
  68. #region Messages
  69. /// <summary>
  70. /// A library is a set of named functions.
  71. /// </summary>
  72. public sealed partial class FunctionDefLibrary : pb::IMessage<FunctionDefLibrary>
  73. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  74. , pb::IBufferMessage
  75. #endif
  76. {
  77. private static readonly pb::MessageParser<FunctionDefLibrary> _parser = new pb::MessageParser<FunctionDefLibrary>(() => new FunctionDefLibrary());
  78. private pb::UnknownFieldSet _unknownFields;
  79. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  80. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  81. public static pb::MessageParser<FunctionDefLibrary> Parser { get { return _parser; } }
  82. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  83. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  84. public static pbr::MessageDescriptor Descriptor {
  85. get { return global::Tensorflow.FunctionReflection.Descriptor.MessageTypes[0]; }
  86. }
  87. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  88. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  89. pbr::MessageDescriptor pb::IMessage.Descriptor {
  90. get { return Descriptor; }
  91. }
  92. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  93. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  94. public FunctionDefLibrary() {
  95. OnConstruction();
  96. }
  97. partial void OnConstruction();
  98. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  99. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  100. public FunctionDefLibrary(FunctionDefLibrary other) : this() {
  101. function_ = other.function_.Clone();
  102. gradient_ = other.gradient_.Clone();
  103. registeredGradients_ = other.registeredGradients_.Clone();
  104. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  105. }
  106. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  107. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  108. public FunctionDefLibrary Clone() {
  109. return new FunctionDefLibrary(this);
  110. }
  111. /// <summary>Field number for the "function" field.</summary>
  112. public const int FunctionFieldNumber = 1;
  113. private static readonly pb::FieldCodec<global::Tensorflow.FunctionDef> _repeated_function_codec
  114. = pb::FieldCodec.ForMessage(10, global::Tensorflow.FunctionDef.Parser);
  115. private readonly pbc::RepeatedField<global::Tensorflow.FunctionDef> function_ = new pbc::RepeatedField<global::Tensorflow.FunctionDef>();
  116. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  117. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  118. public pbc::RepeatedField<global::Tensorflow.FunctionDef> Function {
  119. get { return function_; }
  120. }
  121. /// <summary>Field number for the "gradient" field.</summary>
  122. public const int GradientFieldNumber = 2;
  123. private static readonly pb::FieldCodec<global::Tensorflow.GradientDef> _repeated_gradient_codec
  124. = pb::FieldCodec.ForMessage(18, global::Tensorflow.GradientDef.Parser);
  125. private readonly pbc::RepeatedField<global::Tensorflow.GradientDef> gradient_ = new pbc::RepeatedField<global::Tensorflow.GradientDef>();
  126. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  127. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  128. public pbc::RepeatedField<global::Tensorflow.GradientDef> Gradient {
  129. get { return gradient_; }
  130. }
  131. /// <summary>Field number for the "registered_gradients" field.</summary>
  132. public const int RegisteredGradientsFieldNumber = 3;
  133. private static readonly pb::FieldCodec<global::Tensorflow.RegisteredGradient> _repeated_registeredGradients_codec
  134. = pb::FieldCodec.ForMessage(26, global::Tensorflow.RegisteredGradient.Parser);
  135. private readonly pbc::RepeatedField<global::Tensorflow.RegisteredGradient> registeredGradients_ = new pbc::RepeatedField<global::Tensorflow.RegisteredGradient>();
  136. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  137. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  138. public pbc::RepeatedField<global::Tensorflow.RegisteredGradient> RegisteredGradients {
  139. get { return registeredGradients_; }
  140. }
  141. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  142. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  143. public override bool Equals(object other) {
  144. return Equals(other as FunctionDefLibrary);
  145. }
  146. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  147. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  148. public bool Equals(FunctionDefLibrary other) {
  149. if (ReferenceEquals(other, null)) {
  150. return false;
  151. }
  152. if (ReferenceEquals(other, this)) {
  153. return true;
  154. }
  155. if(!function_.Equals(other.function_)) return false;
  156. if(!gradient_.Equals(other.gradient_)) return false;
  157. if(!registeredGradients_.Equals(other.registeredGradients_)) return false;
  158. return Equals(_unknownFields, other._unknownFields);
  159. }
  160. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  161. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  162. public override int GetHashCode() {
  163. int hash = 1;
  164. hash ^= function_.GetHashCode();
  165. hash ^= gradient_.GetHashCode();
  166. hash ^= registeredGradients_.GetHashCode();
  167. if (_unknownFields != null) {
  168. hash ^= _unknownFields.GetHashCode();
  169. }
  170. return hash;
  171. }
  172. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  173. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  174. public override string ToString() {
  175. return pb::JsonFormatter.ToDiagnosticString(this);
  176. }
  177. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  178. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  179. public void WriteTo(pb::CodedOutputStream output) {
  180. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  181. output.WriteRawMessage(this);
  182. #else
  183. function_.WriteTo(output, _repeated_function_codec);
  184. gradient_.WriteTo(output, _repeated_gradient_codec);
  185. registeredGradients_.WriteTo(output, _repeated_registeredGradients_codec);
  186. if (_unknownFields != null) {
  187. _unknownFields.WriteTo(output);
  188. }
  189. #endif
  190. }
  191. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  192. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  193. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  194. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  195. function_.WriteTo(ref output, _repeated_function_codec);
  196. gradient_.WriteTo(ref output, _repeated_gradient_codec);
  197. registeredGradients_.WriteTo(ref output, _repeated_registeredGradients_codec);
  198. if (_unknownFields != null) {
  199. _unknownFields.WriteTo(ref output);
  200. }
  201. }
  202. #endif
  203. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  204. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  205. public int CalculateSize() {
  206. int size = 0;
  207. size += function_.CalculateSize(_repeated_function_codec);
  208. size += gradient_.CalculateSize(_repeated_gradient_codec);
  209. size += registeredGradients_.CalculateSize(_repeated_registeredGradients_codec);
  210. if (_unknownFields != null) {
  211. size += _unknownFields.CalculateSize();
  212. }
  213. return size;
  214. }
  215. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  216. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  217. public void MergeFrom(FunctionDefLibrary other) {
  218. if (other == null) {
  219. return;
  220. }
  221. function_.Add(other.function_);
  222. gradient_.Add(other.gradient_);
  223. registeredGradients_.Add(other.registeredGradients_);
  224. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  225. }
  226. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  227. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  228. public void MergeFrom(pb::CodedInputStream input) {
  229. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  230. input.ReadRawMessage(this);
  231. #else
  232. uint tag;
  233. while ((tag = input.ReadTag()) != 0) {
  234. switch(tag) {
  235. default:
  236. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  237. break;
  238. case 10: {
  239. function_.AddEntriesFrom(input, _repeated_function_codec);
  240. break;
  241. }
  242. case 18: {
  243. gradient_.AddEntriesFrom(input, _repeated_gradient_codec);
  244. break;
  245. }
  246. case 26: {
  247. registeredGradients_.AddEntriesFrom(input, _repeated_registeredGradients_codec);
  248. break;
  249. }
  250. }
  251. }
  252. #endif
  253. }
  254. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  255. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  256. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  257. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  258. uint tag;
  259. while ((tag = input.ReadTag()) != 0) {
  260. switch(tag) {
  261. default:
  262. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  263. break;
  264. case 10: {
  265. function_.AddEntriesFrom(ref input, _repeated_function_codec);
  266. break;
  267. }
  268. case 18: {
  269. gradient_.AddEntriesFrom(ref input, _repeated_gradient_codec);
  270. break;
  271. }
  272. case 26: {
  273. registeredGradients_.AddEntriesFrom(ref input, _repeated_registeredGradients_codec);
  274. break;
  275. }
  276. }
  277. }
  278. }
  279. #endif
  280. }
  281. /// <summary>
  282. /// A function can be instantiated when the runtime can bind every attr
  283. /// with a value. When a GraphDef has a call to a function, it must
  284. /// have binding for every attr defined in the signature.
  285. ///
  286. /// TODO(zhifengc):
  287. /// * device spec, etc.
  288. /// </summary>
  289. public sealed partial class FunctionDef : pb::IMessage<FunctionDef>
  290. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  291. , pb::IBufferMessage
  292. #endif
  293. {
  294. private static readonly pb::MessageParser<FunctionDef> _parser = new pb::MessageParser<FunctionDef>(() => new FunctionDef());
  295. private pb::UnknownFieldSet _unknownFields;
  296. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  297. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  298. public static pb::MessageParser<FunctionDef> Parser { get { return _parser; } }
  299. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  300. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  301. public static pbr::MessageDescriptor Descriptor {
  302. get { return global::Tensorflow.FunctionReflection.Descriptor.MessageTypes[1]; }
  303. }
  304. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  305. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  306. pbr::MessageDescriptor pb::IMessage.Descriptor {
  307. get { return Descriptor; }
  308. }
  309. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  310. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  311. public FunctionDef() {
  312. OnConstruction();
  313. }
  314. partial void OnConstruction();
  315. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  316. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  317. public FunctionDef(FunctionDef other) : this() {
  318. signature_ = other.signature_ != null ? other.signature_.Clone() : null;
  319. attr_ = other.attr_.Clone();
  320. argAttr_ = other.argAttr_.Clone();
  321. resourceArgUniqueId_ = other.resourceArgUniqueId_.Clone();
  322. nodeDef_ = other.nodeDef_.Clone();
  323. ret_ = other.ret_.Clone();
  324. controlRet_ = other.controlRet_.Clone();
  325. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  326. }
  327. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  328. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  329. public FunctionDef Clone() {
  330. return new FunctionDef(this);
  331. }
  332. /// <summary>Field number for the "signature" field.</summary>
  333. public const int SignatureFieldNumber = 1;
  334. private global::Tensorflow.OpDef signature_;
  335. /// <summary>
  336. /// The definition of the function's name, arguments, return values,
  337. /// attrs etc.
  338. /// </summary>
  339. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  340. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  341. public global::Tensorflow.OpDef Signature {
  342. get { return signature_; }
  343. set {
  344. signature_ = value;
  345. }
  346. }
  347. /// <summary>Field number for the "attr" field.</summary>
  348. public const int AttrFieldNumber = 5;
  349. private static readonly pbc::MapField<string, global::Tensorflow.AttrValue>.Codec _map_attr_codec
  350. = new pbc::MapField<string, global::Tensorflow.AttrValue>.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Tensorflow.AttrValue.Parser), 42);
  351. private readonly pbc::MapField<string, global::Tensorflow.AttrValue> attr_ = new pbc::MapField<string, global::Tensorflow.AttrValue>();
  352. /// <summary>
  353. /// Attributes specific to this function definition.
  354. /// </summary>
  355. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  356. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  357. public pbc::MapField<string, global::Tensorflow.AttrValue> Attr {
  358. get { return attr_; }
  359. }
  360. /// <summary>Field number for the "arg_attr" field.</summary>
  361. public const int ArgAttrFieldNumber = 7;
  362. private static readonly pbc::MapField<uint, global::Tensorflow.FunctionDef.Types.ArgAttrs>.Codec _map_argAttr_codec
  363. = new pbc::MapField<uint, global::Tensorflow.FunctionDef.Types.ArgAttrs>.Codec(pb::FieldCodec.ForUInt32(8, 0), pb::FieldCodec.ForMessage(18, global::Tensorflow.FunctionDef.Types.ArgAttrs.Parser), 58);
  364. private readonly pbc::MapField<uint, global::Tensorflow.FunctionDef.Types.ArgAttrs> argAttr_ = new pbc::MapField<uint, global::Tensorflow.FunctionDef.Types.ArgAttrs>();
  365. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  366. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  367. public pbc::MapField<uint, global::Tensorflow.FunctionDef.Types.ArgAttrs> ArgAttr {
  368. get { return argAttr_; }
  369. }
  370. /// <summary>Field number for the "resource_arg_unique_id" field.</summary>
  371. public const int ResourceArgUniqueIdFieldNumber = 8;
  372. private static readonly pbc::MapField<uint, uint>.Codec _map_resourceArgUniqueId_codec
  373. = new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForUInt32(8, 0), pb::FieldCodec.ForUInt32(16, 0), 66);
  374. private readonly pbc::MapField<uint, uint> resourceArgUniqueId_ = new pbc::MapField<uint, uint>();
  375. /// <summary>
  376. /// Unique IDs for each resource argument, used to track aliasing resources. If
  377. /// Argument A and Argument B alias each other, then
  378. /// resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
  379. ///
  380. /// If this field is empty, none of the arguments could alias; otherwise, every
  381. /// resource argument should have an entry in this field.
  382. ///
  383. /// When instantiated, the unique IDs will be attached to the _Arg nodes'
  384. /// "_resource_arg_unique_id" attribute.
  385. /// </summary>
  386. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  387. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  388. public pbc::MapField<uint, uint> ResourceArgUniqueId {
  389. get { return resourceArgUniqueId_; }
  390. }
  391. /// <summary>Field number for the "node_def" field.</summary>
  392. public const int NodeDefFieldNumber = 3;
  393. private static readonly pb::FieldCodec<global::Tensorflow.NodeDef> _repeated_nodeDef_codec
  394. = pb::FieldCodec.ForMessage(26, global::Tensorflow.NodeDef.Parser);
  395. private readonly pbc::RepeatedField<global::Tensorflow.NodeDef> nodeDef_ = new pbc::RepeatedField<global::Tensorflow.NodeDef>();
  396. /// <summary>
  397. /// By convention, "op" in node_def is resolved by consulting with a
  398. /// user-defined library first. If not resolved, "func" is assumed to
  399. /// be a builtin op.
  400. /// </summary>
  401. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  402. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  403. public pbc::RepeatedField<global::Tensorflow.NodeDef> NodeDef {
  404. get { return nodeDef_; }
  405. }
  406. /// <summary>Field number for the "ret" field.</summary>
  407. public const int RetFieldNumber = 4;
  408. private static readonly pbc::MapField<string, string>.Codec _map_ret_codec
  409. = new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 34);
  410. private readonly pbc::MapField<string, string> ret_ = new pbc::MapField<string, string>();
  411. /// <summary>
  412. /// A mapping from the output arg names from `signature` to the
  413. /// outputs from `node_def` that should be returned by the function.
  414. /// </summary>
  415. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  416. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  417. public pbc::MapField<string, string> Ret {
  418. get { return ret_; }
  419. }
  420. /// <summary>Field number for the "control_ret" field.</summary>
  421. public const int ControlRetFieldNumber = 6;
  422. private static readonly pbc::MapField<string, string>.Codec _map_controlRet_codec
  423. = new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForString(18, ""), 50);
  424. private readonly pbc::MapField<string, string> controlRet_ = new pbc::MapField<string, string>();
  425. /// <summary>
  426. /// A mapping from control output names from `signature` to node names in
  427. /// `node_def` which should be control outputs of this function.
  428. /// </summary>
  429. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  430. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  431. public pbc::MapField<string, string> ControlRet {
  432. get { return controlRet_; }
  433. }
  434. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  435. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  436. public override bool Equals(object other) {
  437. return Equals(other as FunctionDef);
  438. }
  439. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  440. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  441. public bool Equals(FunctionDef other) {
  442. if (ReferenceEquals(other, null)) {
  443. return false;
  444. }
  445. if (ReferenceEquals(other, this)) {
  446. return true;
  447. }
  448. if (!object.Equals(Signature, other.Signature)) return false;
  449. if (!Attr.Equals(other.Attr)) return false;
  450. if (!ArgAttr.Equals(other.ArgAttr)) return false;
  451. if (!ResourceArgUniqueId.Equals(other.ResourceArgUniqueId)) return false;
  452. if(!nodeDef_.Equals(other.nodeDef_)) return false;
  453. if (!Ret.Equals(other.Ret)) return false;
  454. if (!ControlRet.Equals(other.ControlRet)) return false;
  455. return Equals(_unknownFields, other._unknownFields);
  456. }
  457. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  458. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  459. public override int GetHashCode() {
  460. int hash = 1;
  461. if (signature_ != null) hash ^= Signature.GetHashCode();
  462. hash ^= Attr.GetHashCode();
  463. hash ^= ArgAttr.GetHashCode();
  464. hash ^= ResourceArgUniqueId.GetHashCode();
  465. hash ^= nodeDef_.GetHashCode();
  466. hash ^= Ret.GetHashCode();
  467. hash ^= ControlRet.GetHashCode();
  468. if (_unknownFields != null) {
  469. hash ^= _unknownFields.GetHashCode();
  470. }
  471. return hash;
  472. }
  473. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  474. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  475. public override string ToString() {
  476. return pb::JsonFormatter.ToDiagnosticString(this);
  477. }
  478. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  479. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  480. public void WriteTo(pb::CodedOutputStream output) {
  481. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  482. output.WriteRawMessage(this);
  483. #else
  484. if (signature_ != null) {
  485. output.WriteRawTag(10);
  486. output.WriteMessage(Signature);
  487. }
  488. nodeDef_.WriteTo(output, _repeated_nodeDef_codec);
  489. ret_.WriteTo(output, _map_ret_codec);
  490. attr_.WriteTo(output, _map_attr_codec);
  491. controlRet_.WriteTo(output, _map_controlRet_codec);
  492. argAttr_.WriteTo(output, _map_argAttr_codec);
  493. resourceArgUniqueId_.WriteTo(output, _map_resourceArgUniqueId_codec);
  494. if (_unknownFields != null) {
  495. _unknownFields.WriteTo(output);
  496. }
  497. #endif
  498. }
  499. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  500. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  501. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  502. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  503. if (signature_ != null) {
  504. output.WriteRawTag(10);
  505. output.WriteMessage(Signature);
  506. }
  507. nodeDef_.WriteTo(ref output, _repeated_nodeDef_codec);
  508. ret_.WriteTo(ref output, _map_ret_codec);
  509. attr_.WriteTo(ref output, _map_attr_codec);
  510. controlRet_.WriteTo(ref output, _map_controlRet_codec);
  511. argAttr_.WriteTo(ref output, _map_argAttr_codec);
  512. resourceArgUniqueId_.WriteTo(ref output, _map_resourceArgUniqueId_codec);
  513. if (_unknownFields != null) {
  514. _unknownFields.WriteTo(ref output);
  515. }
  516. }
  517. #endif
  518. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  519. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  520. public int CalculateSize() {
  521. int size = 0;
  522. if (signature_ != null) {
  523. size += 1 + pb::CodedOutputStream.ComputeMessageSize(Signature);
  524. }
  525. size += attr_.CalculateSize(_map_attr_codec);
  526. size += argAttr_.CalculateSize(_map_argAttr_codec);
  527. size += resourceArgUniqueId_.CalculateSize(_map_resourceArgUniqueId_codec);
  528. size += nodeDef_.CalculateSize(_repeated_nodeDef_codec);
  529. size += ret_.CalculateSize(_map_ret_codec);
  530. size += controlRet_.CalculateSize(_map_controlRet_codec);
  531. if (_unknownFields != null) {
  532. size += _unknownFields.CalculateSize();
  533. }
  534. return size;
  535. }
  536. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  537. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  538. public void MergeFrom(FunctionDef other) {
  539. if (other == null) {
  540. return;
  541. }
  542. if (other.signature_ != null) {
  543. if (signature_ == null) {
  544. Signature = new global::Tensorflow.OpDef();
  545. }
  546. Signature.MergeFrom(other.Signature);
  547. }
  548. attr_.Add(other.attr_);
  549. argAttr_.Add(other.argAttr_);
  550. resourceArgUniqueId_.Add(other.resourceArgUniqueId_);
  551. nodeDef_.Add(other.nodeDef_);
  552. ret_.Add(other.ret_);
  553. controlRet_.Add(other.controlRet_);
  554. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  555. }
  556. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  557. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  558. public void MergeFrom(pb::CodedInputStream input) {
  559. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  560. input.ReadRawMessage(this);
  561. #else
  562. uint tag;
  563. while ((tag = input.ReadTag()) != 0) {
  564. switch(tag) {
  565. default:
  566. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  567. break;
  568. case 10: {
  569. if (signature_ == null) {
  570. Signature = new global::Tensorflow.OpDef();
  571. }
  572. input.ReadMessage(Signature);
  573. break;
  574. }
  575. case 26: {
  576. nodeDef_.AddEntriesFrom(input, _repeated_nodeDef_codec);
  577. break;
  578. }
  579. case 34: {
  580. ret_.AddEntriesFrom(input, _map_ret_codec);
  581. break;
  582. }
  583. case 42: {
  584. attr_.AddEntriesFrom(input, _map_attr_codec);
  585. break;
  586. }
  587. case 50: {
  588. controlRet_.AddEntriesFrom(input, _map_controlRet_codec);
  589. break;
  590. }
  591. case 58: {
  592. argAttr_.AddEntriesFrom(input, _map_argAttr_codec);
  593. break;
  594. }
  595. case 66: {
  596. resourceArgUniqueId_.AddEntriesFrom(input, _map_resourceArgUniqueId_codec);
  597. break;
  598. }
  599. }
  600. }
  601. #endif
  602. }
  603. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  604. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  605. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  606. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  607. uint tag;
  608. while ((tag = input.ReadTag()) != 0) {
  609. switch(tag) {
  610. default:
  611. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  612. break;
  613. case 10: {
  614. if (signature_ == null) {
  615. Signature = new global::Tensorflow.OpDef();
  616. }
  617. input.ReadMessage(Signature);
  618. break;
  619. }
  620. case 26: {
  621. nodeDef_.AddEntriesFrom(ref input, _repeated_nodeDef_codec);
  622. break;
  623. }
  624. case 34: {
  625. ret_.AddEntriesFrom(ref input, _map_ret_codec);
  626. break;
  627. }
  628. case 42: {
  629. attr_.AddEntriesFrom(ref input, _map_attr_codec);
  630. break;
  631. }
  632. case 50: {
  633. controlRet_.AddEntriesFrom(ref input, _map_controlRet_codec);
  634. break;
  635. }
  636. case 58: {
  637. argAttr_.AddEntriesFrom(ref input, _map_argAttr_codec);
  638. break;
  639. }
  640. case 66: {
  641. resourceArgUniqueId_.AddEntriesFrom(ref input, _map_resourceArgUniqueId_codec);
  642. break;
  643. }
  644. }
  645. }
  646. }
  647. #endif
  648. #region Nested types
  649. /// <summary>Container for nested types declared in the FunctionDef message type.</summary>
  650. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  651. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  652. public static partial class Types {
  653. /// <summary>
  654. /// Attributes for function arguments. These attributes are the same set of
  655. /// valid attributes as to _Arg nodes.
  656. /// </summary>
  657. public sealed partial class ArgAttrs : pb::IMessage<ArgAttrs>
  658. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  659. , pb::IBufferMessage
  660. #endif
  661. {
  662. private static readonly pb::MessageParser<ArgAttrs> _parser = new pb::MessageParser<ArgAttrs>(() => new ArgAttrs());
  663. private pb::UnknownFieldSet _unknownFields;
  664. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  665. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  666. public static pb::MessageParser<ArgAttrs> Parser { get { return _parser; } }
  667. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  668. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  669. public static pbr::MessageDescriptor Descriptor {
  670. get { return global::Tensorflow.FunctionDef.Descriptor.NestedTypes[1]; }
  671. }
  672. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  673. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  674. pbr::MessageDescriptor pb::IMessage.Descriptor {
  675. get { return Descriptor; }
  676. }
  677. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  678. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  679. public ArgAttrs() {
  680. OnConstruction();
  681. }
  682. partial void OnConstruction();
  683. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  684. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  685. public ArgAttrs(ArgAttrs other) : this() {
  686. attr_ = other.attr_.Clone();
  687. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  688. }
  689. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  690. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  691. public ArgAttrs Clone() {
  692. return new ArgAttrs(this);
  693. }
  694. /// <summary>Field number for the "attr" field.</summary>
  695. public const int AttrFieldNumber = 1;
  696. private static readonly pbc::MapField<string, global::Tensorflow.AttrValue>.Codec _map_attr_codec
  697. = new pbc::MapField<string, global::Tensorflow.AttrValue>.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Tensorflow.AttrValue.Parser), 10);
  698. private readonly pbc::MapField<string, global::Tensorflow.AttrValue> attr_ = new pbc::MapField<string, global::Tensorflow.AttrValue>();
  699. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  700. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  701. public pbc::MapField<string, global::Tensorflow.AttrValue> Attr {
  702. get { return attr_; }
  703. }
  704. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  705. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  706. public override bool Equals(object other) {
  707. return Equals(other as ArgAttrs);
  708. }
  709. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  710. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  711. public bool Equals(ArgAttrs other) {
  712. if (ReferenceEquals(other, null)) {
  713. return false;
  714. }
  715. if (ReferenceEquals(other, this)) {
  716. return true;
  717. }
  718. if (!Attr.Equals(other.Attr)) return false;
  719. return Equals(_unknownFields, other._unknownFields);
  720. }
  721. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  722. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  723. public override int GetHashCode() {
  724. int hash = 1;
  725. hash ^= Attr.GetHashCode();
  726. if (_unknownFields != null) {
  727. hash ^= _unknownFields.GetHashCode();
  728. }
  729. return hash;
  730. }
  731. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  732. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  733. public override string ToString() {
  734. return pb::JsonFormatter.ToDiagnosticString(this);
  735. }
  736. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  737. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  738. public void WriteTo(pb::CodedOutputStream output) {
  739. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  740. output.WriteRawMessage(this);
  741. #else
  742. attr_.WriteTo(output, _map_attr_codec);
  743. if (_unknownFields != null) {
  744. _unknownFields.WriteTo(output);
  745. }
  746. #endif
  747. }
  748. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  749. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  750. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  751. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  752. attr_.WriteTo(ref output, _map_attr_codec);
  753. if (_unknownFields != null) {
  754. _unknownFields.WriteTo(ref output);
  755. }
  756. }
  757. #endif
  758. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  759. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  760. public int CalculateSize() {
  761. int size = 0;
  762. size += attr_.CalculateSize(_map_attr_codec);
  763. if (_unknownFields != null) {
  764. size += _unknownFields.CalculateSize();
  765. }
  766. return size;
  767. }
  768. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  769. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  770. public void MergeFrom(ArgAttrs other) {
  771. if (other == null) {
  772. return;
  773. }
  774. attr_.Add(other.attr_);
  775. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  776. }
  777. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  778. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  779. public void MergeFrom(pb::CodedInputStream input) {
  780. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  781. input.ReadRawMessage(this);
  782. #else
  783. uint tag;
  784. while ((tag = input.ReadTag()) != 0) {
  785. switch(tag) {
  786. default:
  787. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  788. break;
  789. case 10: {
  790. attr_.AddEntriesFrom(input, _map_attr_codec);
  791. break;
  792. }
  793. }
  794. }
  795. #endif
  796. }
  797. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  798. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  799. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  800. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  801. uint tag;
  802. while ((tag = input.ReadTag()) != 0) {
  803. switch(tag) {
  804. default:
  805. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  806. break;
  807. case 10: {
  808. attr_.AddEntriesFrom(ref input, _map_attr_codec);
  809. break;
  810. }
  811. }
  812. }
  813. }
  814. #endif
  815. }
  816. }
  817. #endregion
  818. }
  819. /// <summary>
  820. /// GradientDef defines the gradient function of a function defined in
  821. /// a function library.
  822. ///
  823. /// A gradient function g (specified by gradient_func) for a function f
  824. /// (specified by function_name) must follow the following:
  825. ///
  826. /// The function 'f' must be a numerical function which takes N inputs
  827. /// and produces M outputs. Its gradient function 'g', which is a
  828. /// function taking N + M inputs and produces N outputs.
  829. ///
  830. /// I.e. if we have
  831. /// (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
  832. /// then, g is
  833. /// (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
  834. /// dL/dy1, dL/dy2, ..., dL/dy_M),
  835. /// where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
  836. /// loss function). dL/dx_i is the partial derivative of L with respect
  837. /// to x_i.
  838. /// </summary>
  839. public sealed partial class GradientDef : pb::IMessage<GradientDef>
  840. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  841. , pb::IBufferMessage
  842. #endif
  843. {
  844. private static readonly pb::MessageParser<GradientDef> _parser = new pb::MessageParser<GradientDef>(() => new GradientDef());
  845. private pb::UnknownFieldSet _unknownFields;
  846. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  847. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  848. public static pb::MessageParser<GradientDef> Parser { get { return _parser; } }
  849. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  850. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  851. public static pbr::MessageDescriptor Descriptor {
  852. get { return global::Tensorflow.FunctionReflection.Descriptor.MessageTypes[2]; }
  853. }
  854. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  855. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  856. pbr::MessageDescriptor pb::IMessage.Descriptor {
  857. get { return Descriptor; }
  858. }
  859. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  860. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  861. public GradientDef() {
  862. OnConstruction();
  863. }
  864. partial void OnConstruction();
  865. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  866. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  867. public GradientDef(GradientDef other) : this() {
  868. functionName_ = other.functionName_;
  869. gradientFunc_ = other.gradientFunc_;
  870. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  871. }
  872. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  873. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  874. public GradientDef Clone() {
  875. return new GradientDef(this);
  876. }
  877. /// <summary>Field number for the "function_name" field.</summary>
  878. public const int FunctionNameFieldNumber = 1;
  879. private string functionName_ = "";
  880. /// <summary>
  881. /// The function name.
  882. /// </summary>
  883. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  884. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  885. public string FunctionName {
  886. get { return functionName_; }
  887. set {
  888. functionName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  889. }
  890. }
  891. /// <summary>Field number for the "gradient_func" field.</summary>
  892. public const int GradientFuncFieldNumber = 2;
  893. private string gradientFunc_ = "";
  894. /// <summary>
  895. /// The gradient function's name.
  896. /// </summary>
  897. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  898. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  899. public string GradientFunc {
  900. get { return gradientFunc_; }
  901. set {
  902. gradientFunc_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  903. }
  904. }
  905. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  906. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  907. public override bool Equals(object other) {
  908. return Equals(other as GradientDef);
  909. }
  910. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  911. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  912. public bool Equals(GradientDef other) {
  913. if (ReferenceEquals(other, null)) {
  914. return false;
  915. }
  916. if (ReferenceEquals(other, this)) {
  917. return true;
  918. }
  919. if (FunctionName != other.FunctionName) return false;
  920. if (GradientFunc != other.GradientFunc) return false;
  921. return Equals(_unknownFields, other._unknownFields);
  922. }
  923. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  924. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  925. public override int GetHashCode() {
  926. int hash = 1;
  927. if (FunctionName.Length != 0) hash ^= FunctionName.GetHashCode();
  928. if (GradientFunc.Length != 0) hash ^= GradientFunc.GetHashCode();
  929. if (_unknownFields != null) {
  930. hash ^= _unknownFields.GetHashCode();
  931. }
  932. return hash;
  933. }
  934. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  935. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  936. public override string ToString() {
  937. return pb::JsonFormatter.ToDiagnosticString(this);
  938. }
  939. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  940. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  941. public void WriteTo(pb::CodedOutputStream output) {
  942. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  943. output.WriteRawMessage(this);
  944. #else
  945. if (FunctionName.Length != 0) {
  946. output.WriteRawTag(10);
  947. output.WriteString(FunctionName);
  948. }
  949. if (GradientFunc.Length != 0) {
  950. output.WriteRawTag(18);
  951. output.WriteString(GradientFunc);
  952. }
  953. if (_unknownFields != null) {
  954. _unknownFields.WriteTo(output);
  955. }
  956. #endif
  957. }
  958. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  959. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  960. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  961. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  962. if (FunctionName.Length != 0) {
  963. output.WriteRawTag(10);
  964. output.WriteString(FunctionName);
  965. }
  966. if (GradientFunc.Length != 0) {
  967. output.WriteRawTag(18);
  968. output.WriteString(GradientFunc);
  969. }
  970. if (_unknownFields != null) {
  971. _unknownFields.WriteTo(ref output);
  972. }
  973. }
  974. #endif
  975. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  976. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  977. public int CalculateSize() {
  978. int size = 0;
  979. if (FunctionName.Length != 0) {
  980. size += 1 + pb::CodedOutputStream.ComputeStringSize(FunctionName);
  981. }
  982. if (GradientFunc.Length != 0) {
  983. size += 1 + pb::CodedOutputStream.ComputeStringSize(GradientFunc);
  984. }
  985. if (_unknownFields != null) {
  986. size += _unknownFields.CalculateSize();
  987. }
  988. return size;
  989. }
  990. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  991. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  992. public void MergeFrom(GradientDef other) {
  993. if (other == null) {
  994. return;
  995. }
  996. if (other.FunctionName.Length != 0) {
  997. FunctionName = other.FunctionName;
  998. }
  999. if (other.GradientFunc.Length != 0) {
  1000. GradientFunc = other.GradientFunc;
  1001. }
  1002. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1003. }
  1004. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1005. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1006. public void MergeFrom(pb::CodedInputStream input) {
  1007. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1008. input.ReadRawMessage(this);
  1009. #else
  1010. uint tag;
  1011. while ((tag = input.ReadTag()) != 0) {
  1012. switch(tag) {
  1013. default:
  1014. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1015. break;
  1016. case 10: {
  1017. FunctionName = input.ReadString();
  1018. break;
  1019. }
  1020. case 18: {
  1021. GradientFunc = input.ReadString();
  1022. break;
  1023. }
  1024. }
  1025. }
  1026. #endif
  1027. }
  1028. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1029. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1030. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1031. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1032. uint tag;
  1033. while ((tag = input.ReadTag()) != 0) {
  1034. switch(tag) {
  1035. default:
  1036. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1037. break;
  1038. case 10: {
  1039. FunctionName = input.ReadString();
  1040. break;
  1041. }
  1042. case 18: {
  1043. GradientFunc = input.ReadString();
  1044. break;
  1045. }
  1046. }
  1047. }
  1048. }
  1049. #endif
  1050. }
  1051. /// <summary>
  1052. /// RegisteredGradient stores a gradient function that is registered in the
  1053. /// gradients library and used in the ops of a function in the function library.
  1054. /// Unlike GradientDef, these gradients are identified by op type, and not
  1055. /// directly linked to any function.
  1056. /// </summary>
  1057. public sealed partial class RegisteredGradient : pb::IMessage<RegisteredGradient>
  1058. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1059. , pb::IBufferMessage
  1060. #endif
  1061. {
  1062. private static readonly pb::MessageParser<RegisteredGradient> _parser = new pb::MessageParser<RegisteredGradient>(() => new RegisteredGradient());
  1063. private pb::UnknownFieldSet _unknownFields;
  1064. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1065. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1066. public static pb::MessageParser<RegisteredGradient> Parser { get { return _parser; } }
  1067. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1068. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1069. public static pbr::MessageDescriptor Descriptor {
  1070. get { return global::Tensorflow.FunctionReflection.Descriptor.MessageTypes[3]; }
  1071. }
  1072. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1073. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1074. pbr::MessageDescriptor pb::IMessage.Descriptor {
  1075. get { return Descriptor; }
  1076. }
  1077. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1078. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1079. public RegisteredGradient() {
  1080. OnConstruction();
  1081. }
  1082. partial void OnConstruction();
  1083. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1084. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1085. public RegisteredGradient(RegisteredGradient other) : this() {
  1086. gradientFunc_ = other.gradientFunc_;
  1087. registeredOpType_ = other.registeredOpType_;
  1088. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  1089. }
  1090. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1091. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1092. public RegisteredGradient Clone() {
  1093. return new RegisteredGradient(this);
  1094. }
  1095. /// <summary>Field number for the "gradient_func" field.</summary>
  1096. public const int GradientFuncFieldNumber = 1;
  1097. private string gradientFunc_ = "";
  1098. /// <summary>
  1099. /// The gradient function's name.
  1100. /// </summary>
  1101. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1102. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1103. public string GradientFunc {
  1104. get { return gradientFunc_; }
  1105. set {
  1106. gradientFunc_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1107. }
  1108. }
  1109. /// <summary>Field number for the "registered_op_type" field.</summary>
  1110. public const int RegisteredOpTypeFieldNumber = 2;
  1111. private string registeredOpType_ = "";
  1112. /// <summary>
  1113. /// The gradient function's registered op type.
  1114. /// </summary>
  1115. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1116. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1117. public string RegisteredOpType {
  1118. get { return registeredOpType_; }
  1119. set {
  1120. registeredOpType_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  1121. }
  1122. }
  1123. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1124. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1125. public override bool Equals(object other) {
  1126. return Equals(other as RegisteredGradient);
  1127. }
  1128. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1129. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1130. public bool Equals(RegisteredGradient other) {
  1131. if (ReferenceEquals(other, null)) {
  1132. return false;
  1133. }
  1134. if (ReferenceEquals(other, this)) {
  1135. return true;
  1136. }
  1137. if (GradientFunc != other.GradientFunc) return false;
  1138. if (RegisteredOpType != other.RegisteredOpType) return false;
  1139. return Equals(_unknownFields, other._unknownFields);
  1140. }
  1141. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1142. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1143. public override int GetHashCode() {
  1144. int hash = 1;
  1145. if (GradientFunc.Length != 0) hash ^= GradientFunc.GetHashCode();
  1146. if (RegisteredOpType.Length != 0) hash ^= RegisteredOpType.GetHashCode();
  1147. if (_unknownFields != null) {
  1148. hash ^= _unknownFields.GetHashCode();
  1149. }
  1150. return hash;
  1151. }
  1152. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1153. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1154. public override string ToString() {
  1155. return pb::JsonFormatter.ToDiagnosticString(this);
  1156. }
  1157. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1158. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1159. public void WriteTo(pb::CodedOutputStream output) {
  1160. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1161. output.WriteRawMessage(this);
  1162. #else
  1163. if (GradientFunc.Length != 0) {
  1164. output.WriteRawTag(10);
  1165. output.WriteString(GradientFunc);
  1166. }
  1167. if (RegisteredOpType.Length != 0) {
  1168. output.WriteRawTag(18);
  1169. output.WriteString(RegisteredOpType);
  1170. }
  1171. if (_unknownFields != null) {
  1172. _unknownFields.WriteTo(output);
  1173. }
  1174. #endif
  1175. }
  1176. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1177. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1178. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1179. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  1180. if (GradientFunc.Length != 0) {
  1181. output.WriteRawTag(10);
  1182. output.WriteString(GradientFunc);
  1183. }
  1184. if (RegisteredOpType.Length != 0) {
  1185. output.WriteRawTag(18);
  1186. output.WriteString(RegisteredOpType);
  1187. }
  1188. if (_unknownFields != null) {
  1189. _unknownFields.WriteTo(ref output);
  1190. }
  1191. }
  1192. #endif
  1193. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1194. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1195. public int CalculateSize() {
  1196. int size = 0;
  1197. if (GradientFunc.Length != 0) {
  1198. size += 1 + pb::CodedOutputStream.ComputeStringSize(GradientFunc);
  1199. }
  1200. if (RegisteredOpType.Length != 0) {
  1201. size += 1 + pb::CodedOutputStream.ComputeStringSize(RegisteredOpType);
  1202. }
  1203. if (_unknownFields != null) {
  1204. size += _unknownFields.CalculateSize();
  1205. }
  1206. return size;
  1207. }
  1208. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1209. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1210. public void MergeFrom(RegisteredGradient other) {
  1211. if (other == null) {
  1212. return;
  1213. }
  1214. if (other.GradientFunc.Length != 0) {
  1215. GradientFunc = other.GradientFunc;
  1216. }
  1217. if (other.RegisteredOpType.Length != 0) {
  1218. RegisteredOpType = other.RegisteredOpType;
  1219. }
  1220. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1221. }
  1222. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1223. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1224. public void MergeFrom(pb::CodedInputStream input) {
  1225. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1226. input.ReadRawMessage(this);
  1227. #else
  1228. uint tag;
  1229. while ((tag = input.ReadTag()) != 0) {
  1230. switch(tag) {
  1231. default:
  1232. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1233. break;
  1234. case 10: {
  1235. GradientFunc = input.ReadString();
  1236. break;
  1237. }
  1238. case 18: {
  1239. RegisteredOpType = input.ReadString();
  1240. break;
  1241. }
  1242. }
  1243. }
  1244. #endif
  1245. }
  1246. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  1247. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1248. [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
  1249. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  1250. uint tag;
  1251. while ((tag = input.ReadTag()) != 0) {
  1252. switch(tag) {
  1253. default:
  1254. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  1255. break;
  1256. case 10: {
  1257. GradientFunc = input.ReadString();
  1258. break;
  1259. }
  1260. case 18: {
  1261. RegisteredOpType = input.ReadString();
  1262. break;
  1263. }
  1264. }
  1265. }
  1266. }
  1267. #endif
  1268. }
  1269. #endregion
  1270. }
  1271. #endregion Designer generated code