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.

CostGraph.cs 46 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: tensorflow/core/framework/cost_graph.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/cost_graph.proto</summary>
  13. public static partial class CostGraphReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for tensorflow/core/framework/cost_graph.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static CostGraphReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "Cip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2Nvc3RfZ3JhcGgucHJvdG8S",
  24. "CnRlbnNvcmZsb3caLHRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvdGVuc29y",
  25. "X3NoYXBlLnByb3RvGiV0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3R5cGVz",
  26. "LnByb3RvIuAFCgxDb3N0R3JhcGhEZWYSKwoEbm9kZRgBIAMoCzIdLnRlbnNv",
  27. "cmZsb3cuQ29zdEdyYXBoRGVmLk5vZGUaogUKBE5vZGUSDAoEbmFtZRgBIAEo",
  28. "CRIOCgZkZXZpY2UYAiABKAkSCgoCaWQYAyABKAUSOwoKaW5wdXRfaW5mbxgE",
  29. "IAMoCzInLnRlbnNvcmZsb3cuQ29zdEdyYXBoRGVmLk5vZGUuSW5wdXRJbmZv",
  30. "Ej0KC291dHB1dF9pbmZvGAUgAygLMigudGVuc29yZmxvdy5Db3N0R3JhcGhE",
  31. "ZWYuTm9kZS5PdXRwdXRJbmZvEh0KFXRlbXBvcmFyeV9tZW1vcnlfc2l6ZRgG",
  32. "IAEoAxIeChZwZXJzaXN0ZW50X21lbW9yeV9zaXplGAwgASgDEiEKFWhvc3Rf",
  33. "dGVtcF9tZW1vcnlfc2l6ZRgKIAEoA0ICGAESIwoXZGV2aWNlX3RlbXBfbWVt",
  34. "b3J5X3NpemUYCyABKANCAhgBEikKHWRldmljZV9wZXJzaXN0ZW50X21lbW9y",
  35. "eV9zaXplGBAgASgDQgIYARIUCgxjb21wdXRlX2Nvc3QYCSABKAMSFAoMY29t",
  36. "cHV0ZV90aW1lGA4gASgDEhMKC21lbW9yeV90aW1lGA8gASgDEhAKCGlzX2Zp",
  37. "bmFsGAcgASgIEhUKDWNvbnRyb2xfaW5wdXQYCCADKAUSEgoKaW5hY2N1cmF0",
  38. "ZRgRIAEoCBo7CglJbnB1dEluZm8SFgoOcHJlY2VkaW5nX25vZGUYASABKAUS",
  39. "FgoOcHJlY2VkaW5nX3BvcnQYAiABKAUahgEKCk91dHB1dEluZm8SDAoEc2l6",
  40. "ZRgBIAEoAxIYChBhbGlhc19pbnB1dF9wb3J0GAIgASgDEisKBXNoYXBlGAMg",
  41. "ASgLMhwudGVuc29yZmxvdy5UZW5zb3JTaGFwZVByb3RvEiMKBWR0eXBlGAQg",
  42. "ASgOMhQudGVuc29yZmxvdy5EYXRhVHlwZUJvChhvcmcudGVuc29yZmxvdy5m",
  43. "cmFtZXdvcmtCD0Nvc3RHcmFwaFByb3Rvc1ABWj1naXRodWIuY29tL3RlbnNv",
  44. "cmZsb3cvdGVuc29yZmxvdy90ZW5zb3JmbG93L2dvL2NvcmUvZnJhbWV3b3Jr",
  45. "+AEBYgZwcm90bzM="));
  46. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  47. new pbr::FileDescriptor[] { global::Tensorflow.TensorShapeReflection.Descriptor, global::Tensorflow.TypesReflection.Descriptor, },
  48. new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
  49. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.CostGraphDef), global::Tensorflow.CostGraphDef.Parser, new[]{ "Node" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.CostGraphDef.Types.Node), global::Tensorflow.CostGraphDef.Types.Node.Parser, new[]{ "Name", "Device", "Id", "InputInfo", "OutputInfo", "TemporaryMemorySize", "PersistentMemorySize", "HostTempMemorySize", "DeviceTempMemorySize", "DevicePersistentMemorySize", "ComputeCost", "ComputeTime", "MemoryTime", "IsFinal", "ControlInput", "Inaccurate" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.CostGraphDef.Types.Node.Types.InputInfo), global::Tensorflow.CostGraphDef.Types.Node.Types.InputInfo.Parser, new[]{ "PrecedingNode", "PrecedingPort" }, null, null, null),
  50. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.CostGraphDef.Types.Node.Types.OutputInfo), global::Tensorflow.CostGraphDef.Types.Node.Types.OutputInfo.Parser, new[]{ "Size", "AliasInputPort", "Shape", "Dtype" }, null, null, null)})})
  51. }));
  52. }
  53. #endregion
  54. }
  55. #region Messages
  56. public sealed partial class CostGraphDef : pb::IMessage<CostGraphDef> {
  57. private static readonly pb::MessageParser<CostGraphDef> _parser = new pb::MessageParser<CostGraphDef>(() => new CostGraphDef());
  58. private pb::UnknownFieldSet _unknownFields;
  59. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  60. public static pb::MessageParser<CostGraphDef> Parser { get { return _parser; } }
  61. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  62. public static pbr::MessageDescriptor Descriptor {
  63. get { return global::Tensorflow.CostGraphReflection.Descriptor.MessageTypes[0]; }
  64. }
  65. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  66. pbr::MessageDescriptor pb::IMessage.Descriptor {
  67. get { return Descriptor; }
  68. }
  69. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  70. public CostGraphDef() {
  71. OnConstruction();
  72. }
  73. partial void OnConstruction();
  74. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  75. public CostGraphDef(CostGraphDef other) : this() {
  76. node_ = other.node_.Clone();
  77. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  78. }
  79. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  80. public CostGraphDef Clone() {
  81. return new CostGraphDef(this);
  82. }
  83. /// <summary>Field number for the "node" field.</summary>
  84. public const int NodeFieldNumber = 1;
  85. private static readonly pb::FieldCodec<global::Tensorflow.CostGraphDef.Types.Node> _repeated_node_codec
  86. = pb::FieldCodec.ForMessage(10, global::Tensorflow.CostGraphDef.Types.Node.Parser);
  87. private readonly pbc::RepeatedField<global::Tensorflow.CostGraphDef.Types.Node> node_ = new pbc::RepeatedField<global::Tensorflow.CostGraphDef.Types.Node>();
  88. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  89. public pbc::RepeatedField<global::Tensorflow.CostGraphDef.Types.Node> Node {
  90. get { return node_; }
  91. }
  92. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  93. public override bool Equals(object other) {
  94. return Equals(other as CostGraphDef);
  95. }
  96. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  97. public bool Equals(CostGraphDef other) {
  98. if (ReferenceEquals(other, null)) {
  99. return false;
  100. }
  101. if (ReferenceEquals(other, this)) {
  102. return true;
  103. }
  104. if(!node_.Equals(other.node_)) return false;
  105. return Equals(_unknownFields, other._unknownFields);
  106. }
  107. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  108. public override int GetHashCode() {
  109. int hash = 1;
  110. hash ^= node_.GetHashCode();
  111. if (_unknownFields != null) {
  112. hash ^= _unknownFields.GetHashCode();
  113. }
  114. return hash;
  115. }
  116. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  117. public override string ToString() {
  118. return pb::JsonFormatter.ToDiagnosticString(this);
  119. }
  120. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  121. public void WriteTo(pb::CodedOutputStream output) {
  122. node_.WriteTo(output, _repeated_node_codec);
  123. if (_unknownFields != null) {
  124. _unknownFields.WriteTo(output);
  125. }
  126. }
  127. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  128. public int CalculateSize() {
  129. int size = 0;
  130. size += node_.CalculateSize(_repeated_node_codec);
  131. if (_unknownFields != null) {
  132. size += _unknownFields.CalculateSize();
  133. }
  134. return size;
  135. }
  136. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  137. public void MergeFrom(CostGraphDef other) {
  138. if (other == null) {
  139. return;
  140. }
  141. node_.Add(other.node_);
  142. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  143. }
  144. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  145. public void MergeFrom(pb::CodedInputStream input) {
  146. uint tag;
  147. while ((tag = input.ReadTag()) != 0) {
  148. switch(tag) {
  149. default:
  150. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  151. break;
  152. case 10: {
  153. node_.AddEntriesFrom(input, _repeated_node_codec);
  154. break;
  155. }
  156. }
  157. }
  158. }
  159. #region Nested types
  160. /// <summary>Container for nested types declared in the CostGraphDef message type.</summary>
  161. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  162. public static partial class Types {
  163. public sealed partial class Node : pb::IMessage<Node> {
  164. private static readonly pb::MessageParser<Node> _parser = new pb::MessageParser<Node>(() => new Node());
  165. private pb::UnknownFieldSet _unknownFields;
  166. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  167. public static pb::MessageParser<Node> Parser { get { return _parser; } }
  168. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  169. public static pbr::MessageDescriptor Descriptor {
  170. get { return global::Tensorflow.CostGraphDef.Descriptor.NestedTypes[0]; }
  171. }
  172. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  173. pbr::MessageDescriptor pb::IMessage.Descriptor {
  174. get { return Descriptor; }
  175. }
  176. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  177. public Node() {
  178. OnConstruction();
  179. }
  180. partial void OnConstruction();
  181. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  182. public Node(Node other) : this() {
  183. name_ = other.name_;
  184. device_ = other.device_;
  185. id_ = other.id_;
  186. inputInfo_ = other.inputInfo_.Clone();
  187. outputInfo_ = other.outputInfo_.Clone();
  188. temporaryMemorySize_ = other.temporaryMemorySize_;
  189. persistentMemorySize_ = other.persistentMemorySize_;
  190. hostTempMemorySize_ = other.hostTempMemorySize_;
  191. deviceTempMemorySize_ = other.deviceTempMemorySize_;
  192. devicePersistentMemorySize_ = other.devicePersistentMemorySize_;
  193. computeCost_ = other.computeCost_;
  194. computeTime_ = other.computeTime_;
  195. memoryTime_ = other.memoryTime_;
  196. isFinal_ = other.isFinal_;
  197. controlInput_ = other.controlInput_.Clone();
  198. inaccurate_ = other.inaccurate_;
  199. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  200. }
  201. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  202. public Node Clone() {
  203. return new Node(this);
  204. }
  205. /// <summary>Field number for the "name" field.</summary>
  206. public const int NameFieldNumber = 1;
  207. private string name_ = "";
  208. /// <summary>
  209. /// The name of the node. Names are globally unique.
  210. /// </summary>
  211. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  212. public string Name {
  213. get { return name_; }
  214. set {
  215. name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  216. }
  217. }
  218. /// <summary>Field number for the "device" field.</summary>
  219. public const int DeviceFieldNumber = 2;
  220. private string device_ = "";
  221. /// <summary>
  222. /// The device of the node. Can be empty if the node is mapped to the
  223. /// default partition or partitioning hasn't been run yet.
  224. /// </summary>
  225. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  226. public string Device {
  227. get { return device_; }
  228. set {
  229. device_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
  230. }
  231. }
  232. /// <summary>Field number for the "id" field.</summary>
  233. public const int IdFieldNumber = 3;
  234. private int id_;
  235. /// <summary>
  236. /// The id of the node. Node ids are only unique inside a partition.
  237. /// </summary>
  238. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  239. public int Id {
  240. get { return id_; }
  241. set {
  242. id_ = value;
  243. }
  244. }
  245. /// <summary>Field number for the "input_info" field.</summary>
  246. public const int InputInfoFieldNumber = 4;
  247. private static readonly pb::FieldCodec<global::Tensorflow.CostGraphDef.Types.Node.Types.InputInfo> _repeated_inputInfo_codec
  248. = pb::FieldCodec.ForMessage(34, global::Tensorflow.CostGraphDef.Types.Node.Types.InputInfo.Parser);
  249. private readonly pbc::RepeatedField<global::Tensorflow.CostGraphDef.Types.Node.Types.InputInfo> inputInfo_ = new pbc::RepeatedField<global::Tensorflow.CostGraphDef.Types.Node.Types.InputInfo>();
  250. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  251. public pbc::RepeatedField<global::Tensorflow.CostGraphDef.Types.Node.Types.InputInfo> InputInfo {
  252. get { return inputInfo_; }
  253. }
  254. /// <summary>Field number for the "output_info" field.</summary>
  255. public const int OutputInfoFieldNumber = 5;
  256. private static readonly pb::FieldCodec<global::Tensorflow.CostGraphDef.Types.Node.Types.OutputInfo> _repeated_outputInfo_codec
  257. = pb::FieldCodec.ForMessage(42, global::Tensorflow.CostGraphDef.Types.Node.Types.OutputInfo.Parser);
  258. private readonly pbc::RepeatedField<global::Tensorflow.CostGraphDef.Types.Node.Types.OutputInfo> outputInfo_ = new pbc::RepeatedField<global::Tensorflow.CostGraphDef.Types.Node.Types.OutputInfo>();
  259. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  260. public pbc::RepeatedField<global::Tensorflow.CostGraphDef.Types.Node.Types.OutputInfo> OutputInfo {
  261. get { return outputInfo_; }
  262. }
  263. /// <summary>Field number for the "temporary_memory_size" field.</summary>
  264. public const int TemporaryMemorySizeFieldNumber = 6;
  265. private long temporaryMemorySize_;
  266. /// <summary>
  267. /// Temporary memory used by this node.
  268. /// </summary>
  269. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  270. public long TemporaryMemorySize {
  271. get { return temporaryMemorySize_; }
  272. set {
  273. temporaryMemorySize_ = value;
  274. }
  275. }
  276. /// <summary>Field number for the "persistent_memory_size" field.</summary>
  277. public const int PersistentMemorySizeFieldNumber = 12;
  278. private long persistentMemorySize_;
  279. /// <summary>
  280. /// Persistent memory used by this node.
  281. /// </summary>
  282. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  283. public long PersistentMemorySize {
  284. get { return persistentMemorySize_; }
  285. set {
  286. persistentMemorySize_ = value;
  287. }
  288. }
  289. /// <summary>Field number for the "host_temp_memory_size" field.</summary>
  290. public const int HostTempMemorySizeFieldNumber = 10;
  291. private long hostTempMemorySize_;
  292. [global::System.ObsoleteAttribute]
  293. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  294. public long HostTempMemorySize {
  295. get { return hostTempMemorySize_; }
  296. set {
  297. hostTempMemorySize_ = value;
  298. }
  299. }
  300. /// <summary>Field number for the "device_temp_memory_size" field.</summary>
  301. public const int DeviceTempMemorySizeFieldNumber = 11;
  302. private long deviceTempMemorySize_;
  303. [global::System.ObsoleteAttribute]
  304. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  305. public long DeviceTempMemorySize {
  306. get { return deviceTempMemorySize_; }
  307. set {
  308. deviceTempMemorySize_ = value;
  309. }
  310. }
  311. /// <summary>Field number for the "device_persistent_memory_size" field.</summary>
  312. public const int DevicePersistentMemorySizeFieldNumber = 16;
  313. private long devicePersistentMemorySize_;
  314. [global::System.ObsoleteAttribute]
  315. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  316. public long DevicePersistentMemorySize {
  317. get { return devicePersistentMemorySize_; }
  318. set {
  319. devicePersistentMemorySize_ = value;
  320. }
  321. }
  322. /// <summary>Field number for the "compute_cost" field.</summary>
  323. public const int ComputeCostFieldNumber = 9;
  324. private long computeCost_;
  325. /// <summary>
  326. /// Estimate of the computational cost of this node, in microseconds.
  327. /// </summary>
  328. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  329. public long ComputeCost {
  330. get { return computeCost_; }
  331. set {
  332. computeCost_ = value;
  333. }
  334. }
  335. /// <summary>Field number for the "compute_time" field.</summary>
  336. public const int ComputeTimeFieldNumber = 14;
  337. private long computeTime_;
  338. /// <summary>
  339. /// Analytical estimate of the computational cost of this node, in
  340. /// microseconds.
  341. /// </summary>
  342. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  343. public long ComputeTime {
  344. get { return computeTime_; }
  345. set {
  346. computeTime_ = value;
  347. }
  348. }
  349. /// <summary>Field number for the "memory_time" field.</summary>
  350. public const int MemoryTimeFieldNumber = 15;
  351. private long memoryTime_;
  352. /// <summary>
  353. /// Analytical estimate of the memory access cost of this node, in
  354. /// microseconds.
  355. /// </summary>
  356. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  357. public long MemoryTime {
  358. get { return memoryTime_; }
  359. set {
  360. memoryTime_ = value;
  361. }
  362. }
  363. /// <summary>Field number for the "is_final" field.</summary>
  364. public const int IsFinalFieldNumber = 7;
  365. private bool isFinal_;
  366. /// <summary>
  367. /// If true, the output is permanent: it can't be discarded, because this
  368. /// node is part of the "final output". Nodes may depend on final nodes.
  369. /// </summary>
  370. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  371. public bool IsFinal {
  372. get { return isFinal_; }
  373. set {
  374. isFinal_ = value;
  375. }
  376. }
  377. /// <summary>Field number for the "control_input" field.</summary>
  378. public const int ControlInputFieldNumber = 8;
  379. private static readonly pb::FieldCodec<int> _repeated_controlInput_codec
  380. = pb::FieldCodec.ForInt32(66);
  381. private readonly pbc::RepeatedField<int> controlInput_ = new pbc::RepeatedField<int>();
  382. /// <summary>
  383. /// Ids of the control inputs for this node.
  384. /// </summary>
  385. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  386. public pbc::RepeatedField<int> ControlInput {
  387. get { return controlInput_; }
  388. }
  389. /// <summary>Field number for the "inaccurate" field.</summary>
  390. public const int InaccurateFieldNumber = 17;
  391. private bool inaccurate_;
  392. /// <summary>
  393. /// Are the costs inaccurate?
  394. /// </summary>
  395. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  396. public bool Inaccurate {
  397. get { return inaccurate_; }
  398. set {
  399. inaccurate_ = value;
  400. }
  401. }
  402. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  403. public override bool Equals(object other) {
  404. return Equals(other as Node);
  405. }
  406. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  407. public bool Equals(Node other) {
  408. if (ReferenceEquals(other, null)) {
  409. return false;
  410. }
  411. if (ReferenceEquals(other, this)) {
  412. return true;
  413. }
  414. if (Name != other.Name) return false;
  415. if (Device != other.Device) return false;
  416. if (Id != other.Id) return false;
  417. if(!inputInfo_.Equals(other.inputInfo_)) return false;
  418. if(!outputInfo_.Equals(other.outputInfo_)) return false;
  419. if (TemporaryMemorySize != other.TemporaryMemorySize) return false;
  420. if (PersistentMemorySize != other.PersistentMemorySize) return false;
  421. if (HostTempMemorySize != other.HostTempMemorySize) return false;
  422. if (DeviceTempMemorySize != other.DeviceTempMemorySize) return false;
  423. if (DevicePersistentMemorySize != other.DevicePersistentMemorySize) return false;
  424. if (ComputeCost != other.ComputeCost) return false;
  425. if (ComputeTime != other.ComputeTime) return false;
  426. if (MemoryTime != other.MemoryTime) return false;
  427. if (IsFinal != other.IsFinal) return false;
  428. if(!controlInput_.Equals(other.controlInput_)) return false;
  429. if (Inaccurate != other.Inaccurate) return false;
  430. return Equals(_unknownFields, other._unknownFields);
  431. }
  432. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  433. public override int GetHashCode() {
  434. int hash = 1;
  435. if (Name.Length != 0) hash ^= Name.GetHashCode();
  436. if (Device.Length != 0) hash ^= Device.GetHashCode();
  437. if (Id != 0) hash ^= Id.GetHashCode();
  438. hash ^= inputInfo_.GetHashCode();
  439. hash ^= outputInfo_.GetHashCode();
  440. if (TemporaryMemorySize != 0L) hash ^= TemporaryMemorySize.GetHashCode();
  441. if (PersistentMemorySize != 0L) hash ^= PersistentMemorySize.GetHashCode();
  442. if (HostTempMemorySize != 0L) hash ^= HostTempMemorySize.GetHashCode();
  443. if (DeviceTempMemorySize != 0L) hash ^= DeviceTempMemorySize.GetHashCode();
  444. if (DevicePersistentMemorySize != 0L) hash ^= DevicePersistentMemorySize.GetHashCode();
  445. if (ComputeCost != 0L) hash ^= ComputeCost.GetHashCode();
  446. if (ComputeTime != 0L) hash ^= ComputeTime.GetHashCode();
  447. if (MemoryTime != 0L) hash ^= MemoryTime.GetHashCode();
  448. if (IsFinal != false) hash ^= IsFinal.GetHashCode();
  449. hash ^= controlInput_.GetHashCode();
  450. if (Inaccurate != false) hash ^= Inaccurate.GetHashCode();
  451. if (_unknownFields != null) {
  452. hash ^= _unknownFields.GetHashCode();
  453. }
  454. return hash;
  455. }
  456. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  457. public override string ToString() {
  458. return pb::JsonFormatter.ToDiagnosticString(this);
  459. }
  460. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  461. public void WriteTo(pb::CodedOutputStream output) {
  462. if (Name.Length != 0) {
  463. output.WriteRawTag(10);
  464. output.WriteString(Name);
  465. }
  466. if (Device.Length != 0) {
  467. output.WriteRawTag(18);
  468. output.WriteString(Device);
  469. }
  470. if (Id != 0) {
  471. output.WriteRawTag(24);
  472. output.WriteInt32(Id);
  473. }
  474. inputInfo_.WriteTo(output, _repeated_inputInfo_codec);
  475. outputInfo_.WriteTo(output, _repeated_outputInfo_codec);
  476. if (TemporaryMemorySize != 0L) {
  477. output.WriteRawTag(48);
  478. output.WriteInt64(TemporaryMemorySize);
  479. }
  480. if (IsFinal != false) {
  481. output.WriteRawTag(56);
  482. output.WriteBool(IsFinal);
  483. }
  484. controlInput_.WriteTo(output, _repeated_controlInput_codec);
  485. if (ComputeCost != 0L) {
  486. output.WriteRawTag(72);
  487. output.WriteInt64(ComputeCost);
  488. }
  489. if (HostTempMemorySize != 0L) {
  490. output.WriteRawTag(80);
  491. output.WriteInt64(HostTempMemorySize);
  492. }
  493. if (DeviceTempMemorySize != 0L) {
  494. output.WriteRawTag(88);
  495. output.WriteInt64(DeviceTempMemorySize);
  496. }
  497. if (PersistentMemorySize != 0L) {
  498. output.WriteRawTag(96);
  499. output.WriteInt64(PersistentMemorySize);
  500. }
  501. if (ComputeTime != 0L) {
  502. output.WriteRawTag(112);
  503. output.WriteInt64(ComputeTime);
  504. }
  505. if (MemoryTime != 0L) {
  506. output.WriteRawTag(120);
  507. output.WriteInt64(MemoryTime);
  508. }
  509. if (DevicePersistentMemorySize != 0L) {
  510. output.WriteRawTag(128, 1);
  511. output.WriteInt64(DevicePersistentMemorySize);
  512. }
  513. if (Inaccurate != false) {
  514. output.WriteRawTag(136, 1);
  515. output.WriteBool(Inaccurate);
  516. }
  517. if (_unknownFields != null) {
  518. _unknownFields.WriteTo(output);
  519. }
  520. }
  521. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  522. public int CalculateSize() {
  523. int size = 0;
  524. if (Name.Length != 0) {
  525. size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
  526. }
  527. if (Device.Length != 0) {
  528. size += 1 + pb::CodedOutputStream.ComputeStringSize(Device);
  529. }
  530. if (Id != 0) {
  531. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id);
  532. }
  533. size += inputInfo_.CalculateSize(_repeated_inputInfo_codec);
  534. size += outputInfo_.CalculateSize(_repeated_outputInfo_codec);
  535. if (TemporaryMemorySize != 0L) {
  536. size += 1 + pb::CodedOutputStream.ComputeInt64Size(TemporaryMemorySize);
  537. }
  538. if (PersistentMemorySize != 0L) {
  539. size += 1 + pb::CodedOutputStream.ComputeInt64Size(PersistentMemorySize);
  540. }
  541. if (HostTempMemorySize != 0L) {
  542. size += 1 + pb::CodedOutputStream.ComputeInt64Size(HostTempMemorySize);
  543. }
  544. if (DeviceTempMemorySize != 0L) {
  545. size += 1 + pb::CodedOutputStream.ComputeInt64Size(DeviceTempMemorySize);
  546. }
  547. if (DevicePersistentMemorySize != 0L) {
  548. size += 2 + pb::CodedOutputStream.ComputeInt64Size(DevicePersistentMemorySize);
  549. }
  550. if (ComputeCost != 0L) {
  551. size += 1 + pb::CodedOutputStream.ComputeInt64Size(ComputeCost);
  552. }
  553. if (ComputeTime != 0L) {
  554. size += 1 + pb::CodedOutputStream.ComputeInt64Size(ComputeTime);
  555. }
  556. if (MemoryTime != 0L) {
  557. size += 1 + pb::CodedOutputStream.ComputeInt64Size(MemoryTime);
  558. }
  559. if (IsFinal != false) {
  560. size += 1 + 1;
  561. }
  562. size += controlInput_.CalculateSize(_repeated_controlInput_codec);
  563. if (Inaccurate != false) {
  564. size += 2 + 1;
  565. }
  566. if (_unknownFields != null) {
  567. size += _unknownFields.CalculateSize();
  568. }
  569. return size;
  570. }
  571. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  572. public void MergeFrom(Node other) {
  573. if (other == null) {
  574. return;
  575. }
  576. if (other.Name.Length != 0) {
  577. Name = other.Name;
  578. }
  579. if (other.Device.Length != 0) {
  580. Device = other.Device;
  581. }
  582. if (other.Id != 0) {
  583. Id = other.Id;
  584. }
  585. inputInfo_.Add(other.inputInfo_);
  586. outputInfo_.Add(other.outputInfo_);
  587. if (other.TemporaryMemorySize != 0L) {
  588. TemporaryMemorySize = other.TemporaryMemorySize;
  589. }
  590. if (other.PersistentMemorySize != 0L) {
  591. PersistentMemorySize = other.PersistentMemorySize;
  592. }
  593. if (other.HostTempMemorySize != 0L) {
  594. HostTempMemorySize = other.HostTempMemorySize;
  595. }
  596. if (other.DeviceTempMemorySize != 0L) {
  597. DeviceTempMemorySize = other.DeviceTempMemorySize;
  598. }
  599. if (other.DevicePersistentMemorySize != 0L) {
  600. DevicePersistentMemorySize = other.DevicePersistentMemorySize;
  601. }
  602. if (other.ComputeCost != 0L) {
  603. ComputeCost = other.ComputeCost;
  604. }
  605. if (other.ComputeTime != 0L) {
  606. ComputeTime = other.ComputeTime;
  607. }
  608. if (other.MemoryTime != 0L) {
  609. MemoryTime = other.MemoryTime;
  610. }
  611. if (other.IsFinal != false) {
  612. IsFinal = other.IsFinal;
  613. }
  614. controlInput_.Add(other.controlInput_);
  615. if (other.Inaccurate != false) {
  616. Inaccurate = other.Inaccurate;
  617. }
  618. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  619. }
  620. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  621. public void MergeFrom(pb::CodedInputStream input) {
  622. uint tag;
  623. while ((tag = input.ReadTag()) != 0) {
  624. switch(tag) {
  625. default:
  626. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  627. break;
  628. case 10: {
  629. Name = input.ReadString();
  630. break;
  631. }
  632. case 18: {
  633. Device = input.ReadString();
  634. break;
  635. }
  636. case 24: {
  637. Id = input.ReadInt32();
  638. break;
  639. }
  640. case 34: {
  641. inputInfo_.AddEntriesFrom(input, _repeated_inputInfo_codec);
  642. break;
  643. }
  644. case 42: {
  645. outputInfo_.AddEntriesFrom(input, _repeated_outputInfo_codec);
  646. break;
  647. }
  648. case 48: {
  649. TemporaryMemorySize = input.ReadInt64();
  650. break;
  651. }
  652. case 56: {
  653. IsFinal = input.ReadBool();
  654. break;
  655. }
  656. case 66:
  657. case 64: {
  658. controlInput_.AddEntriesFrom(input, _repeated_controlInput_codec);
  659. break;
  660. }
  661. case 72: {
  662. ComputeCost = input.ReadInt64();
  663. break;
  664. }
  665. case 80: {
  666. HostTempMemorySize = input.ReadInt64();
  667. break;
  668. }
  669. case 88: {
  670. DeviceTempMemorySize = input.ReadInt64();
  671. break;
  672. }
  673. case 96: {
  674. PersistentMemorySize = input.ReadInt64();
  675. break;
  676. }
  677. case 112: {
  678. ComputeTime = input.ReadInt64();
  679. break;
  680. }
  681. case 120: {
  682. MemoryTime = input.ReadInt64();
  683. break;
  684. }
  685. case 128: {
  686. DevicePersistentMemorySize = input.ReadInt64();
  687. break;
  688. }
  689. case 136: {
  690. Inaccurate = input.ReadBool();
  691. break;
  692. }
  693. }
  694. }
  695. }
  696. #region Nested types
  697. /// <summary>Container for nested types declared in the Node message type.</summary>
  698. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  699. public static partial class Types {
  700. /// <summary>
  701. /// Inputs of this node. They must be executed before this node can be
  702. /// executed. An input is a particular output of another node, specified
  703. /// by the node id and the output index.
  704. /// </summary>
  705. public sealed partial class InputInfo : pb::IMessage<InputInfo> {
  706. private static readonly pb::MessageParser<InputInfo> _parser = new pb::MessageParser<InputInfo>(() => new InputInfo());
  707. private pb::UnknownFieldSet _unknownFields;
  708. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  709. public static pb::MessageParser<InputInfo> Parser { get { return _parser; } }
  710. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  711. public static pbr::MessageDescriptor Descriptor {
  712. get { return global::Tensorflow.CostGraphDef.Types.Node.Descriptor.NestedTypes[0]; }
  713. }
  714. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  715. pbr::MessageDescriptor pb::IMessage.Descriptor {
  716. get { return Descriptor; }
  717. }
  718. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  719. public InputInfo() {
  720. OnConstruction();
  721. }
  722. partial void OnConstruction();
  723. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  724. public InputInfo(InputInfo other) : this() {
  725. precedingNode_ = other.precedingNode_;
  726. precedingPort_ = other.precedingPort_;
  727. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  728. }
  729. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  730. public InputInfo Clone() {
  731. return new InputInfo(this);
  732. }
  733. /// <summary>Field number for the "preceding_node" field.</summary>
  734. public const int PrecedingNodeFieldNumber = 1;
  735. private int precedingNode_;
  736. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  737. public int PrecedingNode {
  738. get { return precedingNode_; }
  739. set {
  740. precedingNode_ = value;
  741. }
  742. }
  743. /// <summary>Field number for the "preceding_port" field.</summary>
  744. public const int PrecedingPortFieldNumber = 2;
  745. private int precedingPort_;
  746. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  747. public int PrecedingPort {
  748. get { return precedingPort_; }
  749. set {
  750. precedingPort_ = value;
  751. }
  752. }
  753. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  754. public override bool Equals(object other) {
  755. return Equals(other as InputInfo);
  756. }
  757. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  758. public bool Equals(InputInfo other) {
  759. if (ReferenceEquals(other, null)) {
  760. return false;
  761. }
  762. if (ReferenceEquals(other, this)) {
  763. return true;
  764. }
  765. if (PrecedingNode != other.PrecedingNode) return false;
  766. if (PrecedingPort != other.PrecedingPort) return false;
  767. return Equals(_unknownFields, other._unknownFields);
  768. }
  769. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  770. public override int GetHashCode() {
  771. int hash = 1;
  772. if (PrecedingNode != 0) hash ^= PrecedingNode.GetHashCode();
  773. if (PrecedingPort != 0) hash ^= PrecedingPort.GetHashCode();
  774. if (_unknownFields != null) {
  775. hash ^= _unknownFields.GetHashCode();
  776. }
  777. return hash;
  778. }
  779. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  780. public override string ToString() {
  781. return pb::JsonFormatter.ToDiagnosticString(this);
  782. }
  783. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  784. public void WriteTo(pb::CodedOutputStream output) {
  785. if (PrecedingNode != 0) {
  786. output.WriteRawTag(8);
  787. output.WriteInt32(PrecedingNode);
  788. }
  789. if (PrecedingPort != 0) {
  790. output.WriteRawTag(16);
  791. output.WriteInt32(PrecedingPort);
  792. }
  793. if (_unknownFields != null) {
  794. _unknownFields.WriteTo(output);
  795. }
  796. }
  797. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  798. public int CalculateSize() {
  799. int size = 0;
  800. if (PrecedingNode != 0) {
  801. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrecedingNode);
  802. }
  803. if (PrecedingPort != 0) {
  804. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrecedingPort);
  805. }
  806. if (_unknownFields != null) {
  807. size += _unknownFields.CalculateSize();
  808. }
  809. return size;
  810. }
  811. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  812. public void MergeFrom(InputInfo other) {
  813. if (other == null) {
  814. return;
  815. }
  816. if (other.PrecedingNode != 0) {
  817. PrecedingNode = other.PrecedingNode;
  818. }
  819. if (other.PrecedingPort != 0) {
  820. PrecedingPort = other.PrecedingPort;
  821. }
  822. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  823. }
  824. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  825. public void MergeFrom(pb::CodedInputStream input) {
  826. uint tag;
  827. while ((tag = input.ReadTag()) != 0) {
  828. switch(tag) {
  829. default:
  830. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  831. break;
  832. case 8: {
  833. PrecedingNode = input.ReadInt32();
  834. break;
  835. }
  836. case 16: {
  837. PrecedingPort = input.ReadInt32();
  838. break;
  839. }
  840. }
  841. }
  842. }
  843. }
  844. /// <summary>
  845. /// Outputs of this node.
  846. /// </summary>
  847. public sealed partial class OutputInfo : pb::IMessage<OutputInfo> {
  848. private static readonly pb::MessageParser<OutputInfo> _parser = new pb::MessageParser<OutputInfo>(() => new OutputInfo());
  849. private pb::UnknownFieldSet _unknownFields;
  850. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  851. public static pb::MessageParser<OutputInfo> Parser { get { return _parser; } }
  852. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  853. public static pbr::MessageDescriptor Descriptor {
  854. get { return global::Tensorflow.CostGraphDef.Types.Node.Descriptor.NestedTypes[1]; }
  855. }
  856. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  857. pbr::MessageDescriptor pb::IMessage.Descriptor {
  858. get { return Descriptor; }
  859. }
  860. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  861. public OutputInfo() {
  862. OnConstruction();
  863. }
  864. partial void OnConstruction();
  865. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  866. public OutputInfo(OutputInfo other) : this() {
  867. size_ = other.size_;
  868. aliasInputPort_ = other.aliasInputPort_;
  869. shape_ = other.shape_ != null ? other.shape_.Clone() : null;
  870. dtype_ = other.dtype_;
  871. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  872. }
  873. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  874. public OutputInfo Clone() {
  875. return new OutputInfo(this);
  876. }
  877. /// <summary>Field number for the "size" field.</summary>
  878. public const int SizeFieldNumber = 1;
  879. private long size_;
  880. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  881. public long Size {
  882. get { return size_; }
  883. set {
  884. size_ = value;
  885. }
  886. }
  887. /// <summary>Field number for the "alias_input_port" field.</summary>
  888. public const int AliasInputPortFieldNumber = 2;
  889. private long aliasInputPort_;
  890. /// <summary>
  891. /// If >= 0, the output is an alias of an input. Note that an alias input
  892. /// may itself be an alias. The algorithm will therefore need to follow
  893. /// those pointers.
  894. /// </summary>
  895. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  896. public long AliasInputPort {
  897. get { return aliasInputPort_; }
  898. set {
  899. aliasInputPort_ = value;
  900. }
  901. }
  902. /// <summary>Field number for the "shape" field.</summary>
  903. public const int ShapeFieldNumber = 3;
  904. private global::Tensorflow.TensorShapeProto shape_;
  905. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  906. public global::Tensorflow.TensorShapeProto Shape {
  907. get { return shape_; }
  908. set {
  909. shape_ = value;
  910. }
  911. }
  912. /// <summary>Field number for the "dtype" field.</summary>
  913. public const int DtypeFieldNumber = 4;
  914. private global::Tensorflow.DataType dtype_ = 0;
  915. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  916. public global::Tensorflow.DataType Dtype {
  917. get { return dtype_; }
  918. set {
  919. dtype_ = value;
  920. }
  921. }
  922. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  923. public override bool Equals(object other) {
  924. return Equals(other as OutputInfo);
  925. }
  926. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  927. public bool Equals(OutputInfo other) {
  928. if (ReferenceEquals(other, null)) {
  929. return false;
  930. }
  931. if (ReferenceEquals(other, this)) {
  932. return true;
  933. }
  934. if (Size != other.Size) return false;
  935. if (AliasInputPort != other.AliasInputPort) return false;
  936. if (!object.Equals(Shape, other.Shape)) return false;
  937. if (Dtype != other.Dtype) return false;
  938. return Equals(_unknownFields, other._unknownFields);
  939. }
  940. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  941. public override int GetHashCode() {
  942. int hash = 1;
  943. if (Size != 0L) hash ^= Size.GetHashCode();
  944. if (AliasInputPort != 0L) hash ^= AliasInputPort.GetHashCode();
  945. if (shape_ != null) hash ^= Shape.GetHashCode();
  946. if (Dtype != 0) hash ^= Dtype.GetHashCode();
  947. if (_unknownFields != null) {
  948. hash ^= _unknownFields.GetHashCode();
  949. }
  950. return hash;
  951. }
  952. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  953. public override string ToString() {
  954. return pb::JsonFormatter.ToDiagnosticString(this);
  955. }
  956. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  957. public void WriteTo(pb::CodedOutputStream output) {
  958. if (Size != 0L) {
  959. output.WriteRawTag(8);
  960. output.WriteInt64(Size);
  961. }
  962. if (AliasInputPort != 0L) {
  963. output.WriteRawTag(16);
  964. output.WriteInt64(AliasInputPort);
  965. }
  966. if (shape_ != null) {
  967. output.WriteRawTag(26);
  968. output.WriteMessage(Shape);
  969. }
  970. if (Dtype != 0) {
  971. output.WriteRawTag(32);
  972. output.WriteEnum((int) Dtype);
  973. }
  974. if (_unknownFields != null) {
  975. _unknownFields.WriteTo(output);
  976. }
  977. }
  978. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  979. public int CalculateSize() {
  980. int size = 0;
  981. if (Size != 0L) {
  982. size += 1 + pb::CodedOutputStream.ComputeInt64Size(Size);
  983. }
  984. if (AliasInputPort != 0L) {
  985. size += 1 + pb::CodedOutputStream.ComputeInt64Size(AliasInputPort);
  986. }
  987. if (shape_ != null) {
  988. size += 1 + pb::CodedOutputStream.ComputeMessageSize(Shape);
  989. }
  990. if (Dtype != 0) {
  991. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Dtype);
  992. }
  993. if (_unknownFields != null) {
  994. size += _unknownFields.CalculateSize();
  995. }
  996. return size;
  997. }
  998. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  999. public void MergeFrom(OutputInfo other) {
  1000. if (other == null) {
  1001. return;
  1002. }
  1003. if (other.Size != 0L) {
  1004. Size = other.Size;
  1005. }
  1006. if (other.AliasInputPort != 0L) {
  1007. AliasInputPort = other.AliasInputPort;
  1008. }
  1009. if (other.shape_ != null) {
  1010. if (shape_ == null) {
  1011. shape_ = new global::Tensorflow.TensorShapeProto();
  1012. }
  1013. Shape.MergeFrom(other.Shape);
  1014. }
  1015. if (other.Dtype != 0) {
  1016. Dtype = other.Dtype;
  1017. }
  1018. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  1019. }
  1020. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  1021. public void MergeFrom(pb::CodedInputStream input) {
  1022. uint tag;
  1023. while ((tag = input.ReadTag()) != 0) {
  1024. switch(tag) {
  1025. default:
  1026. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  1027. break;
  1028. case 8: {
  1029. Size = input.ReadInt64();
  1030. break;
  1031. }
  1032. case 16: {
  1033. AliasInputPort = input.ReadInt64();
  1034. break;
  1035. }
  1036. case 26: {
  1037. if (shape_ == null) {
  1038. shape_ = new global::Tensorflow.TensorShapeProto();
  1039. }
  1040. input.ReadMessage(shape_);
  1041. break;
  1042. }
  1043. case 32: {
  1044. dtype_ = (global::Tensorflow.DataType) input.ReadEnum();
  1045. break;
  1046. }
  1047. }
  1048. }
  1049. }
  1050. }
  1051. }
  1052. #endregion
  1053. }
  1054. }
  1055. #endregion
  1056. }
  1057. #endregion
  1058. }
  1059. #endregion Designer generated code

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