From b4556262bc43e9b76754f63504dbc1735985d257 Mon Sep 17 00:00:00 2001 From: haiping008 Date: Fri, 22 Feb 2019 14:33:55 -0600 Subject: [PATCH] added ConfigProto for SessionOptions. --- README.md | 11 +- .../Protobuf/AllocationDescription.cs | 337 ++ src/TensorFlowNET.Core/Protobuf/ApiDef.cs | 1328 +++++ src/TensorFlowNET.Core/Protobuf/AttrValue.cs | 49 +- src/TensorFlowNET.Core/Protobuf/Cluster.cs | 339 ++ src/TensorFlowNET.Core/Protobuf/Config.cs | 4270 +++++++++++++++++ src/TensorFlowNET.Core/Protobuf/CostGraph.cs | 1155 +++++ src/TensorFlowNET.Core/Protobuf/Debug.cs | 893 ++++ .../Protobuf/DeviceAttributes.cs | 860 ++++ src/TensorFlowNET.Core/Protobuf/Function.cs | 39 +- src/TensorFlowNET.Core/Protobuf/Graph.cs | 25 +- .../Protobuf/GraphTransferInfo.cs | 1697 +++++++ src/TensorFlowNET.Core/Protobuf/Iterator.cs | 205 + src/TensorFlowNET.Core/Protobuf/KernelDef.cs | 628 +++ src/TensorFlowNET.Core/Protobuf/LogMemory.cs | 1372 ++++++ src/TensorFlowNET.Core/Protobuf/NodeDef.cs | 202 +- src/TensorFlowNET.Core/Protobuf/OpDef.cs | 52 +- src/TensorFlowNET.Core/Protobuf/README.md | 46 +- src/TensorFlowNET.Core/Protobuf/ReaderBase.cs | 265 + .../Protobuf/ResourceHandle.cs | 20 +- .../Protobuf/RewriterConfig.cs | 1435 ++++++ src/TensorFlowNET.Core/Protobuf/StepStats.cs | 1787 +++++++ src/TensorFlowNET.Core/Protobuf/Tensor.cs | 46 +- .../Protobuf/TensorDescription.cs | 259 + .../Protobuf/TensorSlice.cs | 377 ++ src/TensorFlowNET.Core/Protobuf/Types.cs | 50 +- src/TensorFlowNET.Core/Protobuf/Versions.cs | 17 +- .../Sessions/SessionOptions.cs | 16 +- .../Sessions/c_api.session.cs | 13 + test/TensorFlowNET.UnitTest/CSession.cs | 1 + 30 files changed, 17623 insertions(+), 171 deletions(-) create mode 100644 src/TensorFlowNET.Core/Protobuf/AllocationDescription.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/ApiDef.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/Cluster.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/Config.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/CostGraph.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/Debug.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/DeviceAttributes.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/GraphTransferInfo.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/Iterator.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/KernelDef.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/LogMemory.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/ReaderBase.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/RewriterConfig.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/StepStats.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/TensorDescription.cs create mode 100644 src/TensorFlowNET.Core/Protobuf/TensorSlice.cs diff --git a/README.md b/README.md index 48469df0..045ca547 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ TensorFlow.NET provides .NET Standard binding for [TensorFlow](https://www.tenso [![NuGet](https://img.shields.io/nuget/dt/TensorFlow.NET.svg)](https://www.nuget.org/packages/TensorFlow.NET) [![Documentation Status](https://readthedocs.org/projects/tensorflownet/badge/?version=latest)](https://tensorflownet.readthedocs.io/en/latest/?badge=latest) -TensorFlow.NET is a member project of [SciSharp](https://github.com/SciSharp) stack. +TensorFlow.NET is a member project of [SciSharp STACK](https://github.com/SciSharp). ![tensors_flowing](docs/assets/tensors_flowing.gif) @@ -57,6 +57,15 @@ using(var sess = tf.Session()) Read the docs & book [The Definitive Guide to Tensorflow.NET](https://tensorflownet.readthedocs.io/en/latest/FrontCover.html). +More examples: + +* [Hello World](test/TensorFlowNET.Examples/HelloWorld.cs) + +* [Basic Operations](test/TensorFlowNET.Examples/BasicOperations.cs) +* [Image Recognition](test/TensorFlowNET.Examples/ImageRecognition.cs) +* [Linear Regression](test/TensorFlowNET.Examples/LinearRegression.cs) +* [Text Classification with Movie Review](test/TensorFlowNET.Examples/TextClassificationWithMovieReviews.cs) + Star me or raise issue on [Github](https://github.com/SciSharp/TensorFlow.NET) feel free. Scan QR code to join TIM group: diff --git a/src/TensorFlowNET.Core/Protobuf/AllocationDescription.cs b/src/TensorFlowNET.Core/Protobuf/AllocationDescription.cs new file mode 100644 index 00000000..f763af75 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/AllocationDescription.cs @@ -0,0 +1,337 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/allocation_description.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/allocation_description.proto + public static partial class AllocationDescriptionReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/allocation_description.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AllocationDescriptionReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjZ0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2FsbG9jYXRpb25fZGVzY3Jp", + "cHRpb24ucHJvdG8SCnRlbnNvcmZsb3ciowEKFUFsbG9jYXRpb25EZXNjcmlw", + "dGlvbhIXCg9yZXF1ZXN0ZWRfYnl0ZXMYASABKAMSFwoPYWxsb2NhdGVkX2J5", + "dGVzGAIgASgDEhYKDmFsbG9jYXRvcl9uYW1lGAMgASgJEhUKDWFsbG9jYXRp", + "b25faWQYBCABKAMSHAoUaGFzX3NpbmdsZV9yZWZlcmVuY2UYBSABKAgSCwoD", + "cHRyGAYgASgEQnsKGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IbQWxsb2Nh", + "dGlvbkRlc2NyaXB0aW9uUHJvdG9zUAFaPWdpdGh1Yi5jb20vdGVuc29yZmxv", + "dy90ZW5zb3JmbG93L3RlbnNvcmZsb3cvZ28vY29yZS9mcmFtZXdvcmv4AQFi", + "BnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AllocationDescription), global::Tensorflow.AllocationDescription.Parser, new[]{ "RequestedBytes", "AllocatedBytes", "AllocatorName", "AllocationId", "HasSingleReference", "Ptr" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class AllocationDescription : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AllocationDescription()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.AllocationDescriptionReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllocationDescription() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllocationDescription(AllocationDescription other) : this() { + requestedBytes_ = other.requestedBytes_; + allocatedBytes_ = other.allocatedBytes_; + allocatorName_ = other.allocatorName_; + allocationId_ = other.allocationId_; + hasSingleReference_ = other.hasSingleReference_; + ptr_ = other.ptr_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllocationDescription Clone() { + return new AllocationDescription(this); + } + + /// Field number for the "requested_bytes" field. + public const int RequestedBytesFieldNumber = 1; + private long requestedBytes_; + /// + /// Total number of bytes requested + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long RequestedBytes { + get { return requestedBytes_; } + set { + requestedBytes_ = value; + } + } + + /// Field number for the "allocated_bytes" field. + public const int AllocatedBytesFieldNumber = 2; + private long allocatedBytes_; + /// + /// Total number of bytes allocated if known + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllocatedBytes { + get { return allocatedBytes_; } + set { + allocatedBytes_ = value; + } + } + + /// Field number for the "allocator_name" field. + public const int AllocatorNameFieldNumber = 3; + private string allocatorName_ = ""; + /// + /// Name of the allocator used + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string AllocatorName { + get { return allocatorName_; } + set { + allocatorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "allocation_id" field. + public const int AllocationIdFieldNumber = 4; + private long allocationId_; + /// + /// Identifier of the allocated buffer if known + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllocationId { + get { return allocationId_; } + set { + allocationId_ = value; + } + } + + /// Field number for the "has_single_reference" field. + public const int HasSingleReferenceFieldNumber = 5; + private bool hasSingleReference_; + /// + /// Set if this tensor only has one remaining reference + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool HasSingleReference { + get { return hasSingleReference_; } + set { + hasSingleReference_ = value; + } + } + + /// Field number for the "ptr" field. + public const int PtrFieldNumber = 6; + private ulong ptr_; + /// + /// Address of the allocation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ulong Ptr { + get { return ptr_; } + set { + ptr_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AllocationDescription); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AllocationDescription other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RequestedBytes != other.RequestedBytes) return false; + if (AllocatedBytes != other.AllocatedBytes) return false; + if (AllocatorName != other.AllocatorName) return false; + if (AllocationId != other.AllocationId) return false; + if (HasSingleReference != other.HasSingleReference) return false; + if (Ptr != other.Ptr) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (RequestedBytes != 0L) hash ^= RequestedBytes.GetHashCode(); + if (AllocatedBytes != 0L) hash ^= AllocatedBytes.GetHashCode(); + if (AllocatorName.Length != 0) hash ^= AllocatorName.GetHashCode(); + if (AllocationId != 0L) hash ^= AllocationId.GetHashCode(); + if (HasSingleReference != false) hash ^= HasSingleReference.GetHashCode(); + if (Ptr != 0UL) hash ^= Ptr.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (RequestedBytes != 0L) { + output.WriteRawTag(8); + output.WriteInt64(RequestedBytes); + } + if (AllocatedBytes != 0L) { + output.WriteRawTag(16); + output.WriteInt64(AllocatedBytes); + } + if (AllocatorName.Length != 0) { + output.WriteRawTag(26); + output.WriteString(AllocatorName); + } + if (AllocationId != 0L) { + output.WriteRawTag(32); + output.WriteInt64(AllocationId); + } + if (HasSingleReference != false) { + output.WriteRawTag(40); + output.WriteBool(HasSingleReference); + } + if (Ptr != 0UL) { + output.WriteRawTag(48); + output.WriteUInt64(Ptr); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (RequestedBytes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(RequestedBytes); + } + if (AllocatedBytes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocatedBytes); + } + if (AllocatorName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(AllocatorName); + } + if (AllocationId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocationId); + } + if (HasSingleReference != false) { + size += 1 + 1; + } + if (Ptr != 0UL) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Ptr); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AllocationDescription other) { + if (other == null) { + return; + } + if (other.RequestedBytes != 0L) { + RequestedBytes = other.RequestedBytes; + } + if (other.AllocatedBytes != 0L) { + AllocatedBytes = other.AllocatedBytes; + } + if (other.AllocatorName.Length != 0) { + AllocatorName = other.AllocatorName; + } + if (other.AllocationId != 0L) { + AllocationId = other.AllocationId; + } + if (other.HasSingleReference != false) { + HasSingleReference = other.HasSingleReference; + } + if (other.Ptr != 0UL) { + Ptr = other.Ptr; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + RequestedBytes = input.ReadInt64(); + break; + } + case 16: { + AllocatedBytes = input.ReadInt64(); + break; + } + case 26: { + AllocatorName = input.ReadString(); + break; + } + case 32: { + AllocationId = input.ReadInt64(); + break; + } + case 40: { + HasSingleReference = input.ReadBool(); + break; + } + case 48: { + Ptr = input.ReadUInt64(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/ApiDef.cs b/src/TensorFlowNET.Core/Protobuf/ApiDef.cs new file mode 100644 index 00000000..fde35487 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/ApiDef.cs @@ -0,0 +1,1328 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/api_def.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/api_def.proto + public static partial class ApiDefReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/api_def.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ApiDefReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cid0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2FwaV9kZWYucHJvdG8SCnRl", + "bnNvcmZsb3caKnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvYXR0cl92YWx1", + "ZS5wcm90byLhBQoGQXBpRGVmEhUKDWdyYXBoX29wX25hbWUYASABKAkSGwoT", + "ZGVwcmVjYXRpb25fbWVzc2FnZRgMIAEoCRIbChNkZXByZWNhdGlvbl92ZXJz", + "aW9uGA0gASgFEjEKCnZpc2liaWxpdHkYAiABKA4yHS50ZW5zb3JmbG93LkFw", + "aURlZi5WaXNpYmlsaXR5Ei0KCGVuZHBvaW50GAMgAygLMhsudGVuc29yZmxv", + "dy5BcGlEZWYuRW5kcG9pbnQSJgoGaW5fYXJnGAQgAygLMhYudGVuc29yZmxv", + "dy5BcGlEZWYuQXJnEicKB291dF9hcmcYBSADKAsyFi50ZW5zb3JmbG93LkFw", + "aURlZi5BcmcSEQoJYXJnX29yZGVyGAsgAygJEiUKBGF0dHIYBiADKAsyFy50", + "ZW5zb3JmbG93LkFwaURlZi5BdHRyEg8KB3N1bW1hcnkYByABKAkSEwoLZGVz", + "Y3JpcHRpb24YCCABKAkSGgoSZGVzY3JpcHRpb25fcHJlZml4GAkgASgJEhoK", + "EmRlc2NyaXB0aW9uX3N1ZmZpeBgKIAEoCRpJCghFbmRwb2ludBIMCgRuYW1l", + "GAEgASgJEhIKCmRlcHJlY2F0ZWQYAyABKAgSGwoTZGVwcmVjYXRpb25fdmVy", + "c2lvbhgEIAEoBRo7CgNBcmcSDAoEbmFtZRgBIAEoCRIRCglyZW5hbWVfdG8Y", + "AiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkaagoEQXR0chIMCgRuYW1lGAEg", + "ASgJEhEKCXJlbmFtZV90bxgCIAEoCRIsCg1kZWZhdWx0X3ZhbHVlGAMgASgL", + "MhUudGVuc29yZmxvdy5BdHRyVmFsdWUSEwoLZGVzY3JpcHRpb24YBCABKAki", + "RwoKVmlzaWJpbGl0eRIWChJERUZBVUxUX1ZJU0lCSUxJVFkQABILCgdWSVNJ", + "QkxFEAESCAoEU0tJUBACEgoKBkhJRERFThADIikKB0FwaURlZnMSHgoCb3AY", + "ASADKAsyEi50ZW5zb3JmbG93LkFwaURlZkJsChhvcmcudGVuc29yZmxvdy5m", + "cmFtZXdvcmtCDEFwaURlZlByb3Rvc1ABWj1naXRodWIuY29tL3RlbnNvcmZs", + "b3cvdGVuc29yZmxvdy90ZW5zb3JmbG93L2dvL2NvcmUvZnJhbWV3b3Jr+AEB", + "YgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tensorflow.AttrValueReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ApiDef), global::Tensorflow.ApiDef.Parser, new[]{ "GraphOpName", "DeprecationMessage", "DeprecationVersion", "Visibility", "Endpoint", "InArg", "OutArg", "ArgOrder", "Attr", "Summary", "Description", "DescriptionPrefix", "DescriptionSuffix" }, null, new[]{ typeof(global::Tensorflow.ApiDef.Types.Visibility) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ApiDef.Types.Endpoint), global::Tensorflow.ApiDef.Types.Endpoint.Parser, new[]{ "Name", "Deprecated", "DeprecationVersion" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ApiDef.Types.Arg), global::Tensorflow.ApiDef.Types.Arg.Parser, new[]{ "Name", "RenameTo", "Description" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ApiDef.Types.Attr), global::Tensorflow.ApiDef.Types.Attr.Parser, new[]{ "Name", "RenameTo", "DefaultValue", "Description" }, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ApiDefs), global::Tensorflow.ApiDefs.Parser, new[]{ "Op" }, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Used to specify and override the default API & behavior in the + /// generated code for client languages, from what you would get from + /// the OpDef alone. There will be a set of ApiDefs that are common + /// to all client languages, and another set per client language. + /// The per-client-language ApiDefs will inherit values from the + /// common ApiDefs which it can either replace or modify. + /// + /// We separate the API definition from the OpDef so we can evolve the + /// API while remaining backwards compatible when interpretting old + /// graphs. Overrides go in an "api_def.pbtxt" file with a text-format + /// ApiDefs message. + /// + /// WARNING: Be *very* careful changing the API for any existing op -- + /// you can change the semantics of existing code. These changes may + /// need to wait until a major release of TensorFlow to avoid breaking + /// our compatibility promises. + /// + public sealed partial class ApiDef : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiDef()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ApiDefReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ApiDef() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ApiDef(ApiDef other) : this() { + graphOpName_ = other.graphOpName_; + deprecationMessage_ = other.deprecationMessage_; + deprecationVersion_ = other.deprecationVersion_; + visibility_ = other.visibility_; + endpoint_ = other.endpoint_.Clone(); + inArg_ = other.inArg_.Clone(); + outArg_ = other.outArg_.Clone(); + argOrder_ = other.argOrder_.Clone(); + attr_ = other.attr_.Clone(); + summary_ = other.summary_; + description_ = other.description_; + descriptionPrefix_ = other.descriptionPrefix_; + descriptionSuffix_ = other.descriptionSuffix_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ApiDef Clone() { + return new ApiDef(this); + } + + /// Field number for the "graph_op_name" field. + public const int GraphOpNameFieldNumber = 1; + private string graphOpName_ = ""; + /// + /// Name of the op (in the OpDef) to specify the API for. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string GraphOpName { + get { return graphOpName_; } + set { + graphOpName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "deprecation_message" field. + public const int DeprecationMessageFieldNumber = 12; + private string deprecationMessage_ = ""; + /// + /// If this op is deprecated, set deprecation message to the message + /// that should be logged when this op is used. + /// The message should indicate alternative op to use, if any. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string DeprecationMessage { + get { return deprecationMessage_; } + set { + deprecationMessage_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "deprecation_version" field. + public const int DeprecationVersionFieldNumber = 13; + private int deprecationVersion_; + /// + /// Major version when the op will be deleted. For e.g. set this + /// value to 2 if op API should be removed in TensorFlow 2.0 and + /// deprecated in versions before that. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int DeprecationVersion { + get { return deprecationVersion_; } + set { + deprecationVersion_ = value; + } + } + + /// Field number for the "visibility" field. + public const int VisibilityFieldNumber = 2; + private global::Tensorflow.ApiDef.Types.Visibility visibility_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.ApiDef.Types.Visibility Visibility { + get { return visibility_; } + set { + visibility_ = value; + } + } + + /// Field number for the "endpoint" field. + public const int EndpointFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_endpoint_codec + = pb::FieldCodec.ForMessage(26, global::Tensorflow.ApiDef.Types.Endpoint.Parser); + private readonly pbc::RepeatedField endpoint_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Endpoint { + get { return endpoint_; } + } + + /// Field number for the "in_arg" field. + public const int InArgFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_inArg_codec + = pb::FieldCodec.ForMessage(34, global::Tensorflow.ApiDef.Types.Arg.Parser); + private readonly pbc::RepeatedField inArg_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField InArg { + get { return inArg_; } + } + + /// Field number for the "out_arg" field. + public const int OutArgFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_outArg_codec + = pb::FieldCodec.ForMessage(42, global::Tensorflow.ApiDef.Types.Arg.Parser); + private readonly pbc::RepeatedField outArg_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField OutArg { + get { return outArg_; } + } + + /// Field number for the "arg_order" field. + public const int ArgOrderFieldNumber = 11; + private static readonly pb::FieldCodec _repeated_argOrder_codec + = pb::FieldCodec.ForString(90); + private readonly pbc::RepeatedField argOrder_ = new pbc::RepeatedField(); + /// + /// List of original in_arg names to specify new argument order. + /// Length of arg_order should be either empty to keep current order + /// or match size of in_arg. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ArgOrder { + get { return argOrder_; } + } + + /// Field number for the "attr" field. + public const int AttrFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_attr_codec + = pb::FieldCodec.ForMessage(50, global::Tensorflow.ApiDef.Types.Attr.Parser); + private readonly pbc::RepeatedField attr_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Attr { + get { return attr_; } + } + + /// Field number for the "summary" field. + public const int SummaryFieldNumber = 7; + private string summary_ = ""; + /// + /// One-line human-readable description of what the Op does. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Summary { + get { return summary_; } + set { + summary_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "description" field. + public const int DescriptionFieldNumber = 8; + private string description_ = ""; + /// + /// Additional, longer human-readable description of what the Op does. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Description { + get { return description_; } + set { + description_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "description_prefix" field. + public const int DescriptionPrefixFieldNumber = 9; + private string descriptionPrefix_ = ""; + /// + /// Modify an existing/inherited description by adding text to the beginning + /// or end. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string DescriptionPrefix { + get { return descriptionPrefix_; } + set { + descriptionPrefix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "description_suffix" field. + public const int DescriptionSuffixFieldNumber = 10; + private string descriptionSuffix_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string DescriptionSuffix { + get { return descriptionSuffix_; } + set { + descriptionSuffix_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ApiDef); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ApiDef other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (GraphOpName != other.GraphOpName) return false; + if (DeprecationMessage != other.DeprecationMessage) return false; + if (DeprecationVersion != other.DeprecationVersion) return false; + if (Visibility != other.Visibility) return false; + if(!endpoint_.Equals(other.endpoint_)) return false; + if(!inArg_.Equals(other.inArg_)) return false; + if(!outArg_.Equals(other.outArg_)) return false; + if(!argOrder_.Equals(other.argOrder_)) return false; + if(!attr_.Equals(other.attr_)) return false; + if (Summary != other.Summary) return false; + if (Description != other.Description) return false; + if (DescriptionPrefix != other.DescriptionPrefix) return false; + if (DescriptionSuffix != other.DescriptionSuffix) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (GraphOpName.Length != 0) hash ^= GraphOpName.GetHashCode(); + if (DeprecationMessage.Length != 0) hash ^= DeprecationMessage.GetHashCode(); + if (DeprecationVersion != 0) hash ^= DeprecationVersion.GetHashCode(); + if (Visibility != 0) hash ^= Visibility.GetHashCode(); + hash ^= endpoint_.GetHashCode(); + hash ^= inArg_.GetHashCode(); + hash ^= outArg_.GetHashCode(); + hash ^= argOrder_.GetHashCode(); + hash ^= attr_.GetHashCode(); + if (Summary.Length != 0) hash ^= Summary.GetHashCode(); + if (Description.Length != 0) hash ^= Description.GetHashCode(); + if (DescriptionPrefix.Length != 0) hash ^= DescriptionPrefix.GetHashCode(); + if (DescriptionSuffix.Length != 0) hash ^= DescriptionSuffix.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (GraphOpName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(GraphOpName); + } + if (Visibility != 0) { + output.WriteRawTag(16); + output.WriteEnum((int) Visibility); + } + endpoint_.WriteTo(output, _repeated_endpoint_codec); + inArg_.WriteTo(output, _repeated_inArg_codec); + outArg_.WriteTo(output, _repeated_outArg_codec); + attr_.WriteTo(output, _repeated_attr_codec); + if (Summary.Length != 0) { + output.WriteRawTag(58); + output.WriteString(Summary); + } + if (Description.Length != 0) { + output.WriteRawTag(66); + output.WriteString(Description); + } + if (DescriptionPrefix.Length != 0) { + output.WriteRawTag(74); + output.WriteString(DescriptionPrefix); + } + if (DescriptionSuffix.Length != 0) { + output.WriteRawTag(82); + output.WriteString(DescriptionSuffix); + } + argOrder_.WriteTo(output, _repeated_argOrder_codec); + if (DeprecationMessage.Length != 0) { + output.WriteRawTag(98); + output.WriteString(DeprecationMessage); + } + if (DeprecationVersion != 0) { + output.WriteRawTag(104); + output.WriteInt32(DeprecationVersion); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (GraphOpName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(GraphOpName); + } + if (DeprecationMessage.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DeprecationMessage); + } + if (DeprecationVersion != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DeprecationVersion); + } + if (Visibility != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Visibility); + } + size += endpoint_.CalculateSize(_repeated_endpoint_codec); + size += inArg_.CalculateSize(_repeated_inArg_codec); + size += outArg_.CalculateSize(_repeated_outArg_codec); + size += argOrder_.CalculateSize(_repeated_argOrder_codec); + size += attr_.CalculateSize(_repeated_attr_codec); + if (Summary.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Summary); + } + if (Description.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Description); + } + if (DescriptionPrefix.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DescriptionPrefix); + } + if (DescriptionSuffix.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DescriptionSuffix); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ApiDef other) { + if (other == null) { + return; + } + if (other.GraphOpName.Length != 0) { + GraphOpName = other.GraphOpName; + } + if (other.DeprecationMessage.Length != 0) { + DeprecationMessage = other.DeprecationMessage; + } + if (other.DeprecationVersion != 0) { + DeprecationVersion = other.DeprecationVersion; + } + if (other.Visibility != 0) { + Visibility = other.Visibility; + } + endpoint_.Add(other.endpoint_); + inArg_.Add(other.inArg_); + outArg_.Add(other.outArg_); + argOrder_.Add(other.argOrder_); + attr_.Add(other.attr_); + if (other.Summary.Length != 0) { + Summary = other.Summary; + } + if (other.Description.Length != 0) { + Description = other.Description; + } + if (other.DescriptionPrefix.Length != 0) { + DescriptionPrefix = other.DescriptionPrefix; + } + if (other.DescriptionSuffix.Length != 0) { + DescriptionSuffix = other.DescriptionSuffix; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + GraphOpName = input.ReadString(); + break; + } + case 16: { + visibility_ = (global::Tensorflow.ApiDef.Types.Visibility) input.ReadEnum(); + break; + } + case 26: { + endpoint_.AddEntriesFrom(input, _repeated_endpoint_codec); + break; + } + case 34: { + inArg_.AddEntriesFrom(input, _repeated_inArg_codec); + break; + } + case 42: { + outArg_.AddEntriesFrom(input, _repeated_outArg_codec); + break; + } + case 50: { + attr_.AddEntriesFrom(input, _repeated_attr_codec); + break; + } + case 58: { + Summary = input.ReadString(); + break; + } + case 66: { + Description = input.ReadString(); + break; + } + case 74: { + DescriptionPrefix = input.ReadString(); + break; + } + case 82: { + DescriptionSuffix = input.ReadString(); + break; + } + case 90: { + argOrder_.AddEntriesFrom(input, _repeated_argOrder_codec); + break; + } + case 98: { + DeprecationMessage = input.ReadString(); + break; + } + case 104: { + DeprecationVersion = input.ReadInt32(); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the ApiDef message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + public enum Visibility { + /// + /// Normally this is "VISIBLE" unless you are inheriting a + /// different value from another ApiDef. + /// + [pbr::OriginalName("DEFAULT_VISIBILITY")] DefaultVisibility = 0, + /// + /// Publicly visible in the API. + /// + [pbr::OriginalName("VISIBLE")] Visible = 1, + /// + /// Do not include this op in the generated API. If visibility is + /// set to 'SKIP', other fields are ignored for this op. + /// + [pbr::OriginalName("SKIP")] Skip = 2, + /// + /// Hide this op by putting it into an internal namespace (or whatever + /// is appropriate in the target language). + /// + [pbr::OriginalName("HIDDEN")] Hidden = 3, + } + + /// + /// If you specify any endpoint, this will replace all of the + /// inherited endpoints. The first endpoint should be the + /// "canonical" endpoint, and should not be deprecated (unless all + /// endpoints are deprecated). + /// + public sealed partial class Endpoint : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Endpoint()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ApiDef.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Endpoint() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Endpoint(Endpoint other) : this() { + name_ = other.name_; + deprecated_ = other.deprecated_; + deprecationVersion_ = other.deprecationVersion_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Endpoint Clone() { + return new Endpoint(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// Name should be either like "CamelCaseName" or + /// "Package.CamelCaseName". Client-language-specific ApiDefs may + /// use a snake_case convention instead of CamelCase. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "deprecated" field. + public const int DeprecatedFieldNumber = 3; + private bool deprecated_; + /// + /// Set if this endpoint is deprecated. If set to true, a message suggesting + /// to use a non-deprecated endpoint instead will be printed. If all + /// endpoints are deprecated, set deprecation_message in ApiDef instead. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Deprecated { + get { return deprecated_; } + set { + deprecated_ = value; + } + } + + /// Field number for the "deprecation_version" field. + public const int DeprecationVersionFieldNumber = 4; + private int deprecationVersion_; + /// + /// Major version when an endpoint will be deleted. For e.g. set this + /// value to 2 if endpoint should be removed in TensorFlow 2.0 and + /// deprecated in versions before that. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int DeprecationVersion { + get { return deprecationVersion_; } + set { + deprecationVersion_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Endpoint); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Endpoint other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (Deprecated != other.Deprecated) return false; + if (DeprecationVersion != other.DeprecationVersion) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (Deprecated != false) hash ^= Deprecated.GetHashCode(); + if (DeprecationVersion != 0) hash ^= DeprecationVersion.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Deprecated != false) { + output.WriteRawTag(24); + output.WriteBool(Deprecated); + } + if (DeprecationVersion != 0) { + output.WriteRawTag(32); + output.WriteInt32(DeprecationVersion); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (Deprecated != false) { + size += 1 + 1; + } + if (DeprecationVersion != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DeprecationVersion); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Endpoint other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.Deprecated != false) { + Deprecated = other.Deprecated; + } + if (other.DeprecationVersion != 0) { + DeprecationVersion = other.DeprecationVersion; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 24: { + Deprecated = input.ReadBool(); + break; + } + case 32: { + DeprecationVersion = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class Arg : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Arg()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ApiDef.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Arg() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Arg(Arg other) : this() { + name_ = other.name_; + renameTo_ = other.renameTo_; + description_ = other.description_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Arg Clone() { + return new Arg(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "rename_to" field. + public const int RenameToFieldNumber = 2; + private string renameTo_ = ""; + /// + /// Change the name used to access this arg in the API from what + /// is used in the GraphDef. Note that these names in `backticks` + /// will also be replaced in the summary & description fields. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string RenameTo { + get { return renameTo_; } + set { + renameTo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "description" field. + public const int DescriptionFieldNumber = 3; + private string description_ = ""; + /// + /// Note: this will replace any inherited arg doc. There is no + /// current way of modifying arg descriptions (other than replacing + /// them entirely) as can be done with op descriptions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Description { + get { return description_; } + set { + description_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Arg); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Arg other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (RenameTo != other.RenameTo) return false; + if (Description != other.Description) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (RenameTo.Length != 0) hash ^= RenameTo.GetHashCode(); + if (Description.Length != 0) hash ^= Description.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (RenameTo.Length != 0) { + output.WriteRawTag(18); + output.WriteString(RenameTo); + } + if (Description.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Description); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (RenameTo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(RenameTo); + } + if (Description.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Description); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Arg other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.RenameTo.Length != 0) { + RenameTo = other.RenameTo; + } + if (other.Description.Length != 0) { + Description = other.Description; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + RenameTo = input.ReadString(); + break; + } + case 26: { + Description = input.ReadString(); + break; + } + } + } + } + + } + + /// + /// Description of the graph-construction-time configuration of this + /// Op. That is to say, this describes the attr fields that will + /// be specified in the NodeDef. + /// + public sealed partial class Attr : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Attr()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ApiDef.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Attr() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Attr(Attr other) : this() { + name_ = other.name_; + renameTo_ = other.renameTo_; + defaultValue_ = other.defaultValue_ != null ? other.defaultValue_.Clone() : null; + description_ = other.description_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Attr Clone() { + return new Attr(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "rename_to" field. + public const int RenameToFieldNumber = 2; + private string renameTo_ = ""; + /// + /// Change the name used to access this attr in the API from what + /// is used in the GraphDef. Note that these names in `backticks` + /// will also be replaced in the summary & description fields. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string RenameTo { + get { return renameTo_; } + set { + renameTo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "default_value" field. + public const int DefaultValueFieldNumber = 3; + private global::Tensorflow.AttrValue defaultValue_; + /// + /// Specify a new default value to use for this attr. This default + /// will be used when creating new graphs, as opposed to the + /// default in the OpDef, which will be used when interpreting old + /// GraphDefs. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.AttrValue DefaultValue { + get { return defaultValue_; } + set { + defaultValue_ = value; + } + } + + /// Field number for the "description" field. + public const int DescriptionFieldNumber = 4; + private string description_ = ""; + /// + /// Note: this will replace any inherited attr doc, there is no current + /// way of modifying attr descriptions as can be done with op descriptions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Description { + get { return description_; } + set { + description_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Attr); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Attr other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (RenameTo != other.RenameTo) return false; + if (!object.Equals(DefaultValue, other.DefaultValue)) return false; + if (Description != other.Description) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (RenameTo.Length != 0) hash ^= RenameTo.GetHashCode(); + if (defaultValue_ != null) hash ^= DefaultValue.GetHashCode(); + if (Description.Length != 0) hash ^= Description.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (RenameTo.Length != 0) { + output.WriteRawTag(18); + output.WriteString(RenameTo); + } + if (defaultValue_ != null) { + output.WriteRawTag(26); + output.WriteMessage(DefaultValue); + } + if (Description.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Description); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (RenameTo.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(RenameTo); + } + if (defaultValue_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(DefaultValue); + } + if (Description.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Description); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Attr other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.RenameTo.Length != 0) { + RenameTo = other.RenameTo; + } + if (other.defaultValue_ != null) { + if (defaultValue_ == null) { + defaultValue_ = new global::Tensorflow.AttrValue(); + } + DefaultValue.MergeFrom(other.DefaultValue); + } + if (other.Description.Length != 0) { + Description = other.Description; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + RenameTo = input.ReadString(); + break; + } + case 26: { + if (defaultValue_ == null) { + defaultValue_ = new global::Tensorflow.AttrValue(); + } + input.ReadMessage(defaultValue_); + break; + } + case 34: { + Description = input.ReadString(); + break; + } + } + } + } + + } + + } + #endregion + + } + + public sealed partial class ApiDefs : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ApiDefs()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ApiDefReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ApiDefs() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ApiDefs(ApiDefs other) : this() { + op_ = other.op_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ApiDefs Clone() { + return new ApiDefs(this); + } + + /// Field number for the "op" field. + public const int OpFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_op_codec + = pb::FieldCodec.ForMessage(10, global::Tensorflow.ApiDef.Parser); + private readonly pbc::RepeatedField op_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Op { + get { return op_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ApiDefs); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ApiDefs other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!op_.Equals(other.op_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= op_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + op_.WriteTo(output, _repeated_op_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += op_.CalculateSize(_repeated_op_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ApiDefs other) { + if (other == null) { + return; + } + op_.Add(other.op_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + op_.AddEntriesFrom(input, _repeated_op_codec); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/AttrValue.cs b/src/TensorFlowNET.Core/Protobuf/AttrValue.cs index 158179a0..24debee1 100644 --- a/src/TensorFlowNET.Core/Protobuf/AttrValue.cs +++ b/src/TensorFlowNET.Core/Protobuf/AttrValue.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: attr_value.proto +// source: tensorflow/core/framework/attr_value.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Tensorflow { - /// Holder for reflection information generated from attr_value.proto + /// Holder for reflection information generated from tensorflow/core/framework/attr_value.proto public static partial class AttrValueReflection { #region Descriptor - /// File descriptor for attr_value.proto + /// File descriptor for tensorflow/core/framework/attr_value.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,26 +24,29 @@ namespace Tensorflow { static AttrValueReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChBhdHRyX3ZhbHVlLnByb3RvEgp0ZW5zb3JmbG93Ggx0ZW5zb3IucHJvdG8a", - "EnRlbnNvcl9zaGFwZS5wcm90bxoLdHlwZXMucHJvdG8ipgQKCUF0dHJWYWx1", - "ZRILCgFzGAIgASgMSAASCwoBaRgDIAEoA0gAEgsKAWYYBCABKAJIABILCgFi", - "GAUgASgISAASJAoEdHlwZRgGIAEoDjIULnRlbnNvcmZsb3cuRGF0YVR5cGVI", - "ABItCgVzaGFwZRgHIAEoCzIcLnRlbnNvcmZsb3cuVGVuc29yU2hhcGVQcm90", - "b0gAEikKBnRlbnNvchgIIAEoCzIXLnRlbnNvcmZsb3cuVGVuc29yUHJvdG9I", - "ABIvCgRsaXN0GAEgASgLMh8udGVuc29yZmxvdy5BdHRyVmFsdWUuTGlzdFZh", - "bHVlSAASKAoEZnVuYxgKIAEoCzIYLnRlbnNvcmZsb3cuTmFtZUF0dHJMaXN0", - "SAASFQoLcGxhY2Vob2xkZXIYCSABKAlIABrpAQoJTGlzdFZhbHVlEgkKAXMY", - "AiADKAwSDQoBaRgDIAMoA0ICEAESDQoBZhgEIAMoAkICEAESDQoBYhgFIAMo", - "CEICEAESJgoEdHlwZRgGIAMoDjIULnRlbnNvcmZsb3cuRGF0YVR5cGVCAhAB", - "EisKBXNoYXBlGAcgAygLMhwudGVuc29yZmxvdy5UZW5zb3JTaGFwZVByb3Rv", - "EicKBnRlbnNvchgIIAMoCzIXLnRlbnNvcmZsb3cuVGVuc29yUHJvdG8SJgoE", - "ZnVuYxgJIAMoCzIYLnRlbnNvcmZsb3cuTmFtZUF0dHJMaXN0QgcKBXZhbHVl", - "IpIBCgxOYW1lQXR0ckxpc3QSDAoEbmFtZRgBIAEoCRIwCgRhdHRyGAIgAygL", - "MiIudGVuc29yZmxvdy5OYW1lQXR0ckxpc3QuQXR0ckVudHJ5GkIKCUF0dHJF", - "bnRyeRILCgNrZXkYASABKAkSJAoFdmFsdWUYAiABKAsyFS50ZW5zb3JmbG93", - "LkF0dHJWYWx1ZToCOAFCbwoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQg9B", - "dHRyVmFsdWVQcm90b3NQAVo9Z2l0aHViLmNvbS90ZW5zb3JmbG93L3RlbnNv", - "cmZsb3cvdGVuc29yZmxvdy9nby9jb3JlL2ZyYW1ld29ya/gBAWIGcHJvdG8z")); + "Cip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2F0dHJfdmFsdWUucHJvdG8S", + "CnRlbnNvcmZsb3caJnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvdGVuc29y", + "LnByb3RvGix0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNvcl9zaGFw", + "ZS5wcm90bxoldGVuc29yZmxvdy9jb3JlL2ZyYW1ld29yay90eXBlcy5wcm90", + "byKmBAoJQXR0clZhbHVlEgsKAXMYAiABKAxIABILCgFpGAMgASgDSAASCwoB", + "ZhgEIAEoAkgAEgsKAWIYBSABKAhIABIkCgR0eXBlGAYgASgOMhQudGVuc29y", + "Zmxvdy5EYXRhVHlwZUgAEi0KBXNoYXBlGAcgASgLMhwudGVuc29yZmxvdy5U", + "ZW5zb3JTaGFwZVByb3RvSAASKQoGdGVuc29yGAggASgLMhcudGVuc29yZmxv", + "dy5UZW5zb3JQcm90b0gAEi8KBGxpc3QYASABKAsyHy50ZW5zb3JmbG93LkF0", + "dHJWYWx1ZS5MaXN0VmFsdWVIABIoCgRmdW5jGAogASgLMhgudGVuc29yZmxv", + "dy5OYW1lQXR0ckxpc3RIABIVCgtwbGFjZWhvbGRlchgJIAEoCUgAGukBCglM", + "aXN0VmFsdWUSCQoBcxgCIAMoDBINCgFpGAMgAygDQgIQARINCgFmGAQgAygC", + "QgIQARINCgFiGAUgAygIQgIQARImCgR0eXBlGAYgAygOMhQudGVuc29yZmxv", + "dy5EYXRhVHlwZUICEAESKwoFc2hhcGUYByADKAsyHC50ZW5zb3JmbG93LlRl", + "bnNvclNoYXBlUHJvdG8SJwoGdGVuc29yGAggAygLMhcudGVuc29yZmxvdy5U", + "ZW5zb3JQcm90bxImCgRmdW5jGAkgAygLMhgudGVuc29yZmxvdy5OYW1lQXR0", + "ckxpc3RCBwoFdmFsdWUikgEKDE5hbWVBdHRyTGlzdBIMCgRuYW1lGAEgASgJ", + "EjAKBGF0dHIYAiADKAsyIi50ZW5zb3JmbG93Lk5hbWVBdHRyTGlzdC5BdHRy", + "RW50cnkaQgoJQXR0ckVudHJ5EgsKA2tleRgBIAEoCRIkCgV2YWx1ZRgCIAEo", + "CzIVLnRlbnNvcmZsb3cuQXR0clZhbHVlOgI4AUJvChhvcmcudGVuc29yZmxv", + "dy5mcmFtZXdvcmtCD0F0dHJWYWx1ZVByb3Rvc1ABWj1naXRodWIuY29tL3Rl", + "bnNvcmZsb3cvdGVuc29yZmxvdy90ZW5zb3JmbG93L2dvL2NvcmUvZnJhbWV3", + "b3Jr+AEBYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tensorflow.TensorReflection.Descriptor, global::Tensorflow.TensorShapeReflection.Descriptor, global::Tensorflow.TypesReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { diff --git a/src/TensorFlowNET.Core/Protobuf/Cluster.cs b/src/TensorFlowNET.Core/Protobuf/Cluster.cs new file mode 100644 index 00000000..d36f7e23 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/Cluster.cs @@ -0,0 +1,339 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/protobuf/cluster.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/protobuf/cluster.proto + public static partial class ClusterReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/protobuf/cluster.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ClusterReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiZ0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvY2x1c3Rlci5wcm90bxIKdGVu", + "c29yZmxvdyJyCgZKb2JEZWYSDAoEbmFtZRgBIAEoCRIsCgV0YXNrcxgCIAMo", + "CzIdLnRlbnNvcmZsb3cuSm9iRGVmLlRhc2tzRW50cnkaLAoKVGFza3NFbnRy", + "eRILCgNrZXkYASABKAUSDQoFdmFsdWUYAiABKAk6AjgBIi0KCkNsdXN0ZXJE", + "ZWYSHwoDam9iGAEgAygLMhIudGVuc29yZmxvdy5Kb2JEZWZCbgoab3JnLnRl", + "bnNvcmZsb3cuZGlzdHJ1bnRpbWVCDUNsdXN0ZXJQcm90b3NQAVo8Z2l0aHVi", + "LmNvbS90ZW5zb3JmbG93L3RlbnNvcmZsb3cvdGVuc29yZmxvdy9nby9jb3Jl", + "L3Byb3RvYnVm+AEBYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.JobDef), global::Tensorflow.JobDef.Parser, new[]{ "Name", "Tasks" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ClusterDef), global::Tensorflow.ClusterDef.Parser, new[]{ "Job" }, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Defines a single job in a TensorFlow cluster. + /// + public sealed partial class JobDef : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JobDef()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ClusterReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobDef() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobDef(JobDef other) : this() { + name_ = other.name_; + tasks_ = other.tasks_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public JobDef Clone() { + return new JobDef(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// The name of this job. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "tasks" field. + public const int TasksFieldNumber = 2; + private static readonly pbc::MapField.Codec _map_tasks_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForString(18), 18); + private readonly pbc::MapField tasks_ = new pbc::MapField(); + /// + /// Mapping from task ID to "hostname:port" string. + /// + /// If the `name` field contains "worker", and the `tasks` map contains a + /// mapping from 7 to "example.org:2222", then the device prefix + /// "/job:worker/task:7" will be assigned to "example.org:2222". + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField Tasks { + get { return tasks_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as JobDef); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(JobDef other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (!Tasks.Equals(other.Tasks)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + hash ^= Tasks.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + tasks_.WriteTo(output, _map_tasks_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + size += tasks_.CalculateSize(_map_tasks_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(JobDef other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + tasks_.Add(other.tasks_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + tasks_.AddEntriesFrom(input, _map_tasks_codec); + break; + } + } + } + } + + } + + /// + /// Defines a TensorFlow cluster as a set of jobs. + /// + public sealed partial class ClusterDef : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClusterDef()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ClusterReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClusterDef() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClusterDef(ClusterDef other) : this() { + job_ = other.job_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ClusterDef Clone() { + return new ClusterDef(this); + } + + /// Field number for the "job" field. + public const int JobFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_job_codec + = pb::FieldCodec.ForMessage(10, global::Tensorflow.JobDef.Parser); + private readonly pbc::RepeatedField job_ = new pbc::RepeatedField(); + /// + /// The jobs that comprise the cluster. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Job { + get { return job_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ClusterDef); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ClusterDef other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!job_.Equals(other.job_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= job_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + job_.WriteTo(output, _repeated_job_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += job_.CalculateSize(_repeated_job_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ClusterDef other) { + if (other == null) { + return; + } + job_.Add(other.job_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + job_.AddEntriesFrom(input, _repeated_job_codec); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/Config.cs b/src/TensorFlowNET.Core/Protobuf/Config.cs new file mode 100644 index 00000000..7eb798e3 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/Config.cs @@ -0,0 +1,4270 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/protobuf/config.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/protobuf/config.proto + public static partial class ConfigReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/protobuf/config.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ConfigReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiV0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvY29uZmlnLnByb3RvEgp0ZW5z", + "b3JmbG93Gip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2Nvc3RfZ3JhcGgu", + "cHJvdG8aJXRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvZ3JhcGgucHJvdG8a", + "KnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvc3RlcF9zdGF0cy5wcm90bxok", + "dGVuc29yZmxvdy9jb3JlL3Byb3RvYnVmL2RlYnVnLnByb3RvGiZ0ZW5zb3Jm", + "bG93L2NvcmUvcHJvdG9idWYvY2x1c3Rlci5wcm90bxoudGVuc29yZmxvdy9j", + "b3JlL3Byb3RvYnVmL3Jld3JpdGVyX2NvbmZpZy5wcm90byKtBAoKR1BVT3B0", + "aW9ucxInCh9wZXJfcHJvY2Vzc19ncHVfbWVtb3J5X2ZyYWN0aW9uGAEgASgB", + "EhQKDGFsbG93X2dyb3d0aBgEIAEoCBIWCg5hbGxvY2F0b3JfdHlwZRgCIAEo", + "CRIfChdkZWZlcnJlZF9kZWxldGlvbl9ieXRlcxgDIAEoAxIbChN2aXNpYmxl", + "X2RldmljZV9saXN0GAUgASgJEiIKGnBvbGxpbmdfYWN0aXZlX2RlbGF5X3Vz", + "ZWNzGAYgASgFEiQKHHBvbGxpbmdfaW5hY3RpdmVfZGVsYXlfbXNlY3MYByAB", + "KAUSHAoUZm9yY2VfZ3B1X2NvbXBhdGlibGUYCCABKAgSOQoMZXhwZXJpbWVu", + "dGFsGAkgASgLMiMudGVuc29yZmxvdy5HUFVPcHRpb25zLkV4cGVyaW1lbnRh", + "bBrmAQoMRXhwZXJpbWVudGFsEksKD3ZpcnR1YWxfZGV2aWNlcxgBIAMoCzIy", + "LnRlbnNvcmZsb3cuR1BVT3B0aW9ucy5FeHBlcmltZW50YWwuVmlydHVhbERl", + "dmljZXMSGgoSdXNlX3VuaWZpZWRfbWVtb3J5GAIgASgIEiMKG251bV9kZXZf", + "dG9fZGV2X2NvcHlfc3RyZWFtcxgDIAEoBRIdChVjb2xsZWN0aXZlX3Jpbmdf", + "b3JkZXIYBCABKAkaKQoOVmlydHVhbERldmljZXMSFwoPbWVtb3J5X2xpbWl0", + "X21iGAEgAygCIoUDChBPcHRpbWl6ZXJPcHRpb25zEisKI2RvX2NvbW1vbl9z", + "dWJleHByZXNzaW9uX2VsaW1pbmF0aW9uGAEgASgIEhsKE2RvX2NvbnN0YW50", + "X2ZvbGRpbmcYAiABKAgSJAocbWF4X2ZvbGRlZF9jb25zdGFudF9pbl9ieXRl", + "cxgGIAEoAxIcChRkb19mdW5jdGlvbl9pbmxpbmluZxgEIAEoCBI1CglvcHRf", + "bGV2ZWwYAyABKA4yIi50ZW5zb3JmbG93Lk9wdGltaXplck9wdGlvbnMuTGV2", + "ZWwSRQoQZ2xvYmFsX2ppdF9sZXZlbBgFIAEoDjIrLnRlbnNvcmZsb3cuT3B0", + "aW1pemVyT3B0aW9ucy5HbG9iYWxKaXRMZXZlbCIgCgVMZXZlbBIGCgJMMRAA", + "Eg8KAkwwEP///////////wEiQwoOR2xvYmFsSml0TGV2ZWwSCwoHREVGQVVM", + "VBAAEhAKA09GRhD///////////8BEggKBE9OXzEQARIICgRPTl8yEAIi7gIK", + "DEdyYXBoT3B0aW9ucxIeChZlbmFibGVfcmVjdl9zY2hlZHVsaW5nGAIgASgI", + "EjcKEW9wdGltaXplcl9vcHRpb25zGAMgASgLMhwudGVuc29yZmxvdy5PcHRp", + "bWl6ZXJPcHRpb25zEhgKEGJ1aWxkX2Nvc3RfbW9kZWwYBCABKAMSHgoWYnVp", + "bGRfY29zdF9tb2RlbF9hZnRlchgJIAEoAxIUCgxpbmZlcl9zaGFwZXMYBSAB", + "KAgSGgoScGxhY2VfcHJ1bmVkX2dyYXBoGAYgASgIEiAKGGVuYWJsZV9iZmxv", + "YXQxNl9zZW5kcmVjdhgHIAEoCBIVCg10aW1lbGluZV9zdGVwGAggASgFEjMK", + "D3Jld3JpdGVfb3B0aW9ucxgKIAEoCzIaLnRlbnNvcmZsb3cuUmV3cml0ZXJD", + "b25maWdKBAgBEAJSJXNraXBfY29tbW9uX3N1YmV4cHJlc3Npb25fZWxpbWlu", + "YXRpb24iQQoVVGhyZWFkUG9vbE9wdGlvblByb3RvEhMKC251bV90aHJlYWRz", + "GAEgASgFEhMKC2dsb2JhbF9uYW1lGAIgASgJImwKClJQQ09wdGlvbnMSJAoc", + "dXNlX3JwY19mb3JfaW5wcm9jZXNzX21hc3RlchgBIAEoCBIdChVjb21wcmVz", + "c2lvbl9hbGdvcml0aG0YAiABKAkSGQoRY29tcHJlc3Npb25fbGV2ZWwYAyAB", + "KAUi3wYKC0NvbmZpZ1Byb3RvEj4KDGRldmljZV9jb3VudBgBIAMoCzIoLnRl", + "bnNvcmZsb3cuQ29uZmlnUHJvdG8uRGV2aWNlQ291bnRFbnRyeRIkChxpbnRy", + "YV9vcF9wYXJhbGxlbGlzbV90aHJlYWRzGAIgASgFEiQKHGludGVyX29wX3Bh", + "cmFsbGVsaXNtX3RocmVhZHMYBSABKAUSHwoXdXNlX3Blcl9zZXNzaW9uX3Ro", + "cmVhZHMYCSABKAgSRwocc2Vzc2lvbl9pbnRlcl9vcF90aHJlYWRfcG9vbBgM", + "IAMoCzIhLnRlbnNvcmZsb3cuVGhyZWFkUG9vbE9wdGlvblByb3RvEhgKEHBs", + "YWNlbWVudF9wZXJpb2QYAyABKAUSFgoOZGV2aWNlX2ZpbHRlcnMYBCADKAkS", + "KwoLZ3B1X29wdGlvbnMYBiABKAsyFi50ZW5zb3JmbG93LkdQVU9wdGlvbnMS", + "HAoUYWxsb3dfc29mdF9wbGFjZW1lbnQYByABKAgSHAoUbG9nX2RldmljZV9w", + "bGFjZW1lbnQYCCABKAgSLwoNZ3JhcGhfb3B0aW9ucxgKIAEoCzIYLnRlbnNv", + "cmZsb3cuR3JhcGhPcHRpb25zEh8KF29wZXJhdGlvbl90aW1lb3V0X2luX21z", + "GAsgASgDEisKC3JwY19vcHRpb25zGA0gASgLMhYudGVuc29yZmxvdy5SUENP", + "cHRpb25zEisKC2NsdXN0ZXJfZGVmGA4gASgLMhYudGVuc29yZmxvdy5DbHVz", + "dGVyRGVmEh0KFWlzb2xhdGVfc2Vzc2lvbl9zdGF0ZRgPIAEoCBI6CgxleHBl", + "cmltZW50YWwYECABKAsyJC50ZW5zb3JmbG93LkNvbmZpZ1Byb3RvLkV4cGVy", + "aW1lbnRhbBoyChBEZXZpY2VDb3VudEVudHJ5EgsKA2tleRgBIAEoCRINCgV2", + "YWx1ZRgCIAEoBToCOAEagwEKDEV4cGVyaW1lbnRhbBIfChdjb2xsZWN0aXZl", + "X2dyb3VwX2xlYWRlchgBIAEoCRIVCg1leGVjdXRvcl90eXBlGAMgASgJEhoK", + "EnJlY3ZfYnVmX21heF9jaHVuaxgEIAEoBRIZChF1c2VfbnVtYV9hZmZpbml0", + "eRgFIAEoCEoECAIQAyLYAwoKUnVuT3B0aW9ucxI2Cgt0cmFjZV9sZXZlbBgB", + "IAEoDjIhLnRlbnNvcmZsb3cuUnVuT3B0aW9ucy5UcmFjZUxldmVsEhUKDXRp", + "bWVvdXRfaW5fbXMYAiABKAMSHAoUaW50ZXJfb3BfdGhyZWFkX3Bvb2wYAyAB", + "KAUSHwoXb3V0cHV0X3BhcnRpdGlvbl9ncmFwaHMYBSABKAgSLwoNZGVidWdf", + "b3B0aW9ucxgGIAEoCzIYLnRlbnNvcmZsb3cuRGVidWdPcHRpb25zEioKInJl", + "cG9ydF90ZW5zb3JfYWxsb2NhdGlvbnNfdXBvbl9vb20YByABKAgSOQoMZXhw", + "ZXJpbWVudGFsGAggASgLMiMudGVuc29yZmxvdy5SdW5PcHRpb25zLkV4cGVy", + "aW1lbnRhbBpKCgxFeHBlcmltZW50YWwSHAoUY29sbGVjdGl2ZV9ncmFwaF9r", + "ZXkYASABKAMSHAoUdXNlX3J1bl9oYW5kbGVyX3Bvb2wYAiABKAgiUgoKVHJh", + "Y2VMZXZlbBIMCghOT19UUkFDRRAAEhIKDlNPRlRXQVJFX1RSQUNFEAESEgoO", + "SEFSRFdBUkVfVFJBQ0UQAhIOCgpGVUxMX1RSQUNFEANKBAgEEAUilgEKC1J1", + "bk1ldGFkYXRhEikKCnN0ZXBfc3RhdHMYASABKAsyFS50ZW5zb3JmbG93LlN0", + "ZXBTdGF0cxIsCgpjb3N0X2dyYXBoGAIgASgLMhgudGVuc29yZmxvdy5Db3N0", + "R3JhcGhEZWYSLgoQcGFydGl0aW9uX2dyYXBocxgDIAMoCzIULnRlbnNvcmZs", + "b3cuR3JhcGhEZWYiOgoQVGVuc29yQ29ubmVjdGlvbhITCgtmcm9tX3RlbnNv", + "chgBIAEoCRIRCgl0b190ZW5zb3IYAiABKAkisAMKD0NhbGxhYmxlT3B0aW9u", + "cxIMCgRmZWVkGAEgAygJEg0KBWZldGNoGAIgAygJEg4KBnRhcmdldBgDIAMo", + "CRIrCgtydW5fb3B0aW9ucxgEIAEoCzIWLnRlbnNvcmZsb3cuUnVuT3B0aW9u", + "cxI3ChF0ZW5zb3JfY29ubmVjdGlvbhgFIAMoCzIcLnRlbnNvcmZsb3cuVGVu", + "c29yQ29ubmVjdGlvbhJCCgxmZWVkX2RldmljZXMYBiADKAsyLC50ZW5zb3Jm", + "bG93LkNhbGxhYmxlT3B0aW9ucy5GZWVkRGV2aWNlc0VudHJ5EkQKDWZldGNo", + "X2RldmljZXMYByADKAsyLS50ZW5zb3JmbG93LkNhbGxhYmxlT3B0aW9ucy5G", + "ZXRjaERldmljZXNFbnRyeRIXCg9mZXRjaF9za2lwX3N5bmMYCCABKAgaMgoQ", + "RmVlZERldmljZXNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6", + "AjgBGjMKEUZldGNoRGV2aWNlc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1", + "ZRgCIAEoCToCOAFCLQoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQgxDb25m", + "aWdQcm90b3NQAfgBAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tensorflow.CostGraphReflection.Descriptor, global::Tensorflow.GraphReflection.Descriptor, global::Tensorflow.StepStatsReflection.Descriptor, global::Tensorflow.DebugReflection.Descriptor, global::Tensorflow.ClusterReflection.Descriptor, global::Tensorflow.RewriterConfigReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GPUOptions), global::Tensorflow.GPUOptions.Parser, new[]{ "PerProcessGpuMemoryFraction", "AllowGrowth", "AllocatorType", "DeferredDeletionBytes", "VisibleDeviceList", "PollingActiveDelayUsecs", "PollingInactiveDelayMsecs", "ForceGpuCompatible", "Experimental" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GPUOptions.Types.Experimental), global::Tensorflow.GPUOptions.Types.Experimental.Parser, new[]{ "VirtualDevices", "UseUnifiedMemory", "NumDevToDevCopyStreams", "CollectiveRingOrder" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GPUOptions.Types.Experimental.Types.VirtualDevices), global::Tensorflow.GPUOptions.Types.Experimental.Types.VirtualDevices.Parser, new[]{ "MemoryLimitMb" }, null, null, null)})}), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.OptimizerOptions), global::Tensorflow.OptimizerOptions.Parser, new[]{ "DoCommonSubexpressionElimination", "DoConstantFolding", "MaxFoldedConstantInBytes", "DoFunctionInlining", "OptLevel", "GlobalJitLevel" }, null, new[]{ typeof(global::Tensorflow.OptimizerOptions.Types.Level), typeof(global::Tensorflow.OptimizerOptions.Types.GlobalJitLevel) }, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GraphOptions), global::Tensorflow.GraphOptions.Parser, new[]{ "EnableRecvScheduling", "OptimizerOptions", "BuildCostModel", "BuildCostModelAfter", "InferShapes", "PlacePrunedGraph", "EnableBfloat16Sendrecv", "TimelineStep", "RewriteOptions" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ThreadPoolOptionProto), global::Tensorflow.ThreadPoolOptionProto.Parser, new[]{ "NumThreads", "GlobalName" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.RPCOptions), global::Tensorflow.RPCOptions.Parser, new[]{ "UseRpcForInprocessMaster", "CompressionAlgorithm", "CompressionLevel" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ConfigProto), global::Tensorflow.ConfigProto.Parser, new[]{ "DeviceCount", "IntraOpParallelismThreads", "InterOpParallelismThreads", "UsePerSessionThreads", "SessionInterOpThreadPool", "PlacementPeriod", "DeviceFilters", "GpuOptions", "AllowSoftPlacement", "LogDevicePlacement", "GraphOptions", "OperationTimeoutInMs", "RpcOptions", "ClusterDef", "IsolateSessionState", "Experimental" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ConfigProto.Types.Experimental), global::Tensorflow.ConfigProto.Types.Experimental.Parser, new[]{ "CollectiveGroupLeader", "ExecutorType", "RecvBufMaxChunk", "UseNumaAffinity" }, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.RunOptions), global::Tensorflow.RunOptions.Parser, new[]{ "TraceLevel", "TimeoutInMs", "InterOpThreadPool", "OutputPartitionGraphs", "DebugOptions", "ReportTensorAllocationsUponOom", "Experimental" }, null, new[]{ typeof(global::Tensorflow.RunOptions.Types.TraceLevel) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.RunOptions.Types.Experimental), global::Tensorflow.RunOptions.Types.Experimental.Parser, new[]{ "CollectiveGraphKey", "UseRunHandlerPool" }, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.RunMetadata), global::Tensorflow.RunMetadata.Parser, new[]{ "StepStats", "CostGraph", "PartitionGraphs" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.TensorConnection), global::Tensorflow.TensorConnection.Parser, new[]{ "FromTensor", "ToTensor" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.CallableOptions), global::Tensorflow.CallableOptions.Parser, new[]{ "Feed", "Fetch", "Target", "RunOptions", "TensorConnection", "FeedDevices", "FetchDevices", "FetchSkipSync" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, null, }) + })); + } + #endregion + + } + #region Messages + public sealed partial class GPUOptions : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GPUOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GPUOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GPUOptions(GPUOptions other) : this() { + perProcessGpuMemoryFraction_ = other.perProcessGpuMemoryFraction_; + allowGrowth_ = other.allowGrowth_; + allocatorType_ = other.allocatorType_; + deferredDeletionBytes_ = other.deferredDeletionBytes_; + visibleDeviceList_ = other.visibleDeviceList_; + pollingActiveDelayUsecs_ = other.pollingActiveDelayUsecs_; + pollingInactiveDelayMsecs_ = other.pollingInactiveDelayMsecs_; + forceGpuCompatible_ = other.forceGpuCompatible_; + experimental_ = other.experimental_ != null ? other.experimental_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GPUOptions Clone() { + return new GPUOptions(this); + } + + /// Field number for the "per_process_gpu_memory_fraction" field. + public const int PerProcessGpuMemoryFractionFieldNumber = 1; + private double perProcessGpuMemoryFraction_; + /// + /// Fraction of the available GPU memory to allocate for each process. + /// 1 means to allocate all of the GPU memory, 0.5 means the process + /// allocates up to ~50% of the available GPU memory. + /// + /// GPU memory is pre-allocated unless the allow_growth option is enabled. + /// + /// If greater than 1.0, uses CUDA unified memory to potentially oversubscribe + /// the amount of memory available on the GPU device by using host memory as a + /// swap space. Accessing memory not available on the device will be + /// significantly slower as that would require memory transfer between the host + /// and the device. Options to reduce the memory requirement should be + /// considered before enabling this option as this may come with a negative + /// performance impact. Oversubscription using the unified memory requires + /// Pascal class or newer GPUs and it is currently only supported on the Linux + /// operating system. See + /// https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements + /// for the detailed requirements. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double PerProcessGpuMemoryFraction { + get { return perProcessGpuMemoryFraction_; } + set { + perProcessGpuMemoryFraction_ = value; + } + } + + /// Field number for the "allow_growth" field. + public const int AllowGrowthFieldNumber = 4; + private bool allowGrowth_; + /// + /// If true, the allocator does not pre-allocate the entire specified + /// GPU memory region, instead starting small and growing as needed. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool AllowGrowth { + get { return allowGrowth_; } + set { + allowGrowth_ = value; + } + } + + /// Field number for the "allocator_type" field. + public const int AllocatorTypeFieldNumber = 2; + private string allocatorType_ = ""; + /// + /// The type of GPU allocation strategy to use. + /// + /// Allowed values: + /// "": The empty string (default) uses a system-chosen default + /// which may change over time. + /// + /// "BFC": A "Best-fit with coalescing" algorithm, simplified from a + /// version of dlmalloc. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string AllocatorType { + get { return allocatorType_; } + set { + allocatorType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "deferred_deletion_bytes" field. + public const int DeferredDeletionBytesFieldNumber = 3; + private long deferredDeletionBytes_; + /// + /// Delay deletion of up to this many bytes to reduce the number of + /// interactions with gpu driver code. If 0, the system chooses + /// a reasonable default (several MBs). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long DeferredDeletionBytes { + get { return deferredDeletionBytes_; } + set { + deferredDeletionBytes_ = value; + } + } + + /// Field number for the "visible_device_list" field. + public const int VisibleDeviceListFieldNumber = 5; + private string visibleDeviceList_ = ""; + /// + /// A comma-separated list of GPU ids that determines the 'visible' + /// to 'virtual' mapping of GPU devices. For example, if TensorFlow + /// can see 8 GPU devices in the process, and one wanted to map + /// visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1", + /// then one would specify this field as "5,3". This field is similar in + /// spirit to the CUDA_VISIBLE_DEVICES environment variable, except + /// it applies to the visible GPU devices in the process. + /// + /// NOTE: + /// 1. The GPU driver provides the process with the visible GPUs + /// in an order which is not guaranteed to have any correlation to + /// the *physical* GPU id in the machine. This field is used for + /// remapping "visible" to "virtual", which means this operates only + /// after the process starts. Users are required to use vendor + /// specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the + /// physical to visible device mapping prior to invoking TensorFlow. + /// 2. In the code, the ids in this list are also called "platform GPU id"s, + /// and the 'virtual' ids of GPU devices (i.e. the ids in the device + /// name "/device:GPU:<id>") are also called "TF GPU id"s. Please + /// refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h + /// for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string VisibleDeviceList { + get { return visibleDeviceList_; } + set { + visibleDeviceList_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "polling_active_delay_usecs" field. + public const int PollingActiveDelayUsecsFieldNumber = 6; + private int pollingActiveDelayUsecs_; + /// + /// In the event polling loop sleep this many microseconds between + /// PollEvents calls, when the queue is not empty. If value is not + /// set or set to 0, gets set to a non-zero default. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PollingActiveDelayUsecs { + get { return pollingActiveDelayUsecs_; } + set { + pollingActiveDelayUsecs_ = value; + } + } + + /// Field number for the "polling_inactive_delay_msecs" field. + public const int PollingInactiveDelayMsecsFieldNumber = 7; + private int pollingInactiveDelayMsecs_; + /// + /// This field is deprecated and ignored. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PollingInactiveDelayMsecs { + get { return pollingInactiveDelayMsecs_; } + set { + pollingInactiveDelayMsecs_ = value; + } + } + + /// Field number for the "force_gpu_compatible" field. + public const int ForceGpuCompatibleFieldNumber = 8; + private bool forceGpuCompatible_; + /// + /// Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow, + /// enabling this option forces all CPU tensors to be allocated with Cuda + /// pinned memory. Normally, TensorFlow will infer which tensors should be + /// allocated as the pinned memory. But in case where the inference is + /// incomplete, this option can significantly speed up the cross-device memory + /// copy performance as long as it fits the memory. + /// Note that this option is not something that should be + /// enabled by default for unknown or very large models, since all Cuda pinned + /// memory is unpageable, having too much pinned memory might negatively impact + /// the overall host system performance. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool ForceGpuCompatible { + get { return forceGpuCompatible_; } + set { + forceGpuCompatible_ = value; + } + } + + /// Field number for the "experimental" field. + public const int ExperimentalFieldNumber = 9; + private global::Tensorflow.GPUOptions.Types.Experimental experimental_; + /// + /// Everything inside experimental is subject to change and is not subject + /// to API stability guarantees in + /// https://www.tensorflow.org/guide/version_compat. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.GPUOptions.Types.Experimental Experimental { + get { return experimental_; } + set { + experimental_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GPUOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GPUOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(PerProcessGpuMemoryFraction, other.PerProcessGpuMemoryFraction)) return false; + if (AllowGrowth != other.AllowGrowth) return false; + if (AllocatorType != other.AllocatorType) return false; + if (DeferredDeletionBytes != other.DeferredDeletionBytes) return false; + if (VisibleDeviceList != other.VisibleDeviceList) return false; + if (PollingActiveDelayUsecs != other.PollingActiveDelayUsecs) return false; + if (PollingInactiveDelayMsecs != other.PollingInactiveDelayMsecs) return false; + if (ForceGpuCompatible != other.ForceGpuCompatible) return false; + if (!object.Equals(Experimental, other.Experimental)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (PerProcessGpuMemoryFraction != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PerProcessGpuMemoryFraction); + if (AllowGrowth != false) hash ^= AllowGrowth.GetHashCode(); + if (AllocatorType.Length != 0) hash ^= AllocatorType.GetHashCode(); + if (DeferredDeletionBytes != 0L) hash ^= DeferredDeletionBytes.GetHashCode(); + if (VisibleDeviceList.Length != 0) hash ^= VisibleDeviceList.GetHashCode(); + if (PollingActiveDelayUsecs != 0) hash ^= PollingActiveDelayUsecs.GetHashCode(); + if (PollingInactiveDelayMsecs != 0) hash ^= PollingInactiveDelayMsecs.GetHashCode(); + if (ForceGpuCompatible != false) hash ^= ForceGpuCompatible.GetHashCode(); + if (experimental_ != null) hash ^= Experimental.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (PerProcessGpuMemoryFraction != 0D) { + output.WriteRawTag(9); + output.WriteDouble(PerProcessGpuMemoryFraction); + } + if (AllocatorType.Length != 0) { + output.WriteRawTag(18); + output.WriteString(AllocatorType); + } + if (DeferredDeletionBytes != 0L) { + output.WriteRawTag(24); + output.WriteInt64(DeferredDeletionBytes); + } + if (AllowGrowth != false) { + output.WriteRawTag(32); + output.WriteBool(AllowGrowth); + } + if (VisibleDeviceList.Length != 0) { + output.WriteRawTag(42); + output.WriteString(VisibleDeviceList); + } + if (PollingActiveDelayUsecs != 0) { + output.WriteRawTag(48); + output.WriteInt32(PollingActiveDelayUsecs); + } + if (PollingInactiveDelayMsecs != 0) { + output.WriteRawTag(56); + output.WriteInt32(PollingInactiveDelayMsecs); + } + if (ForceGpuCompatible != false) { + output.WriteRawTag(64); + output.WriteBool(ForceGpuCompatible); + } + if (experimental_ != null) { + output.WriteRawTag(74); + output.WriteMessage(Experimental); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (PerProcessGpuMemoryFraction != 0D) { + size += 1 + 8; + } + if (AllowGrowth != false) { + size += 1 + 1; + } + if (AllocatorType.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(AllocatorType); + } + if (DeferredDeletionBytes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(DeferredDeletionBytes); + } + if (VisibleDeviceList.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(VisibleDeviceList); + } + if (PollingActiveDelayUsecs != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PollingActiveDelayUsecs); + } + if (PollingInactiveDelayMsecs != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PollingInactiveDelayMsecs); + } + if (ForceGpuCompatible != false) { + size += 1 + 1; + } + if (experimental_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Experimental); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GPUOptions other) { + if (other == null) { + return; + } + if (other.PerProcessGpuMemoryFraction != 0D) { + PerProcessGpuMemoryFraction = other.PerProcessGpuMemoryFraction; + } + if (other.AllowGrowth != false) { + AllowGrowth = other.AllowGrowth; + } + if (other.AllocatorType.Length != 0) { + AllocatorType = other.AllocatorType; + } + if (other.DeferredDeletionBytes != 0L) { + DeferredDeletionBytes = other.DeferredDeletionBytes; + } + if (other.VisibleDeviceList.Length != 0) { + VisibleDeviceList = other.VisibleDeviceList; + } + if (other.PollingActiveDelayUsecs != 0) { + PollingActiveDelayUsecs = other.PollingActiveDelayUsecs; + } + if (other.PollingInactiveDelayMsecs != 0) { + PollingInactiveDelayMsecs = other.PollingInactiveDelayMsecs; + } + if (other.ForceGpuCompatible != false) { + ForceGpuCompatible = other.ForceGpuCompatible; + } + if (other.experimental_ != null) { + if (experimental_ == null) { + experimental_ = new global::Tensorflow.GPUOptions.Types.Experimental(); + } + Experimental.MergeFrom(other.Experimental); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 9: { + PerProcessGpuMemoryFraction = input.ReadDouble(); + break; + } + case 18: { + AllocatorType = input.ReadString(); + break; + } + case 24: { + DeferredDeletionBytes = input.ReadInt64(); + break; + } + case 32: { + AllowGrowth = input.ReadBool(); + break; + } + case 42: { + VisibleDeviceList = input.ReadString(); + break; + } + case 48: { + PollingActiveDelayUsecs = input.ReadInt32(); + break; + } + case 56: { + PollingInactiveDelayMsecs = input.ReadInt32(); + break; + } + case 64: { + ForceGpuCompatible = input.ReadBool(); + break; + } + case 74: { + if (experimental_ == null) { + experimental_ = new global::Tensorflow.GPUOptions.Types.Experimental(); + } + input.ReadMessage(experimental_); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the GPUOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + public sealed partial class Experimental : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Experimental()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.GPUOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Experimental() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Experimental(Experimental other) : this() { + virtualDevices_ = other.virtualDevices_.Clone(); + useUnifiedMemory_ = other.useUnifiedMemory_; + numDevToDevCopyStreams_ = other.numDevToDevCopyStreams_; + collectiveRingOrder_ = other.collectiveRingOrder_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Experimental Clone() { + return new Experimental(this); + } + + /// Field number for the "virtual_devices" field. + public const int VirtualDevicesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_virtualDevices_codec + = pb::FieldCodec.ForMessage(10, global::Tensorflow.GPUOptions.Types.Experimental.Types.VirtualDevices.Parser); + private readonly pbc::RepeatedField virtualDevices_ = new pbc::RepeatedField(); + /// + /// The multi virtual device settings. If empty (not set), it will create + /// single virtual device on each visible GPU, according to the settings + /// in "visible_device_list" above. Otherwise, the number of elements in the + /// list must be the same as the number of visible GPUs (after + /// "visible_device_list" filtering if it is set), and the string represented + /// device names (e.g. /device:GPU:<id>) will refer to the virtual + /// devices and have the <id> field assigned sequentially starting from 0, + /// according to the order they appear in this list and the "memory_limit" + /// list inside each element. For example, + /// visible_device_list = "1,0" + /// virtual_devices { memory_limit: 1GB memory_limit: 2GB } + /// virtual_devices {} + /// will create three virtual devices as: + /// /device:GPU:0 -> visible GPU 1 with 1GB memory + /// /device:GPU:1 -> visible GPU 1 with 2GB memory + /// /device:GPU:2 -> visible GPU 0 with all available memory + /// + /// NOTE: + /// 1. It's invalid to set both this and "per_process_gpu_memory_fraction" + /// at the same time. + /// 2. Currently this setting is per-process, not per-session. Using + /// different settings in different sessions within same process will + /// result in undefined behavior. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField VirtualDevices { + get { return virtualDevices_; } + } + + /// Field number for the "use_unified_memory" field. + public const int UseUnifiedMemoryFieldNumber = 2; + private bool useUnifiedMemory_; + /// + /// If true, uses CUDA unified memory for memory allocations. If + /// per_process_gpu_memory_fraction option is greater than 1.0, then unified + /// memory is used regardless of the value for this field. See comments for + /// per_process_gpu_memory_fraction field for more details and requirements + /// of the unified memory. This option is useful to oversubscribe memory if + /// multiple processes are sharing a single GPU while individually using less + /// than 1.0 per process memory fraction. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool UseUnifiedMemory { + get { return useUnifiedMemory_; } + set { + useUnifiedMemory_ = value; + } + } + + /// Field number for the "num_dev_to_dev_copy_streams" field. + public const int NumDevToDevCopyStreamsFieldNumber = 3; + private int numDevToDevCopyStreams_; + /// + /// If > 1, the number of device-to-device copy streams to create + /// for each GPUDevice. Default value is 0, which is automatically + /// converted to 1. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int NumDevToDevCopyStreams { + get { return numDevToDevCopyStreams_; } + set { + numDevToDevCopyStreams_ = value; + } + } + + /// Field number for the "collective_ring_order" field. + public const int CollectiveRingOrderFieldNumber = 4; + private string collectiveRingOrder_ = ""; + /// + /// If non-empty, defines a good GPU ring order on a single worker based on + /// device interconnect. This assumes that all workers have the same GPU + /// topology. Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4". + /// This ring order is used by the RingReducer implementation of + /// CollectiveReduce, and serves as an override to automatic ring order + /// generation in OrderTaskDeviceMap() during CollectiveParam resolution. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string CollectiveRingOrder { + get { return collectiveRingOrder_; } + set { + collectiveRingOrder_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Experimental); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Experimental other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!virtualDevices_.Equals(other.virtualDevices_)) return false; + if (UseUnifiedMemory != other.UseUnifiedMemory) return false; + if (NumDevToDevCopyStreams != other.NumDevToDevCopyStreams) return false; + if (CollectiveRingOrder != other.CollectiveRingOrder) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= virtualDevices_.GetHashCode(); + if (UseUnifiedMemory != false) hash ^= UseUnifiedMemory.GetHashCode(); + if (NumDevToDevCopyStreams != 0) hash ^= NumDevToDevCopyStreams.GetHashCode(); + if (CollectiveRingOrder.Length != 0) hash ^= CollectiveRingOrder.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + virtualDevices_.WriteTo(output, _repeated_virtualDevices_codec); + if (UseUnifiedMemory != false) { + output.WriteRawTag(16); + output.WriteBool(UseUnifiedMemory); + } + if (NumDevToDevCopyStreams != 0) { + output.WriteRawTag(24); + output.WriteInt32(NumDevToDevCopyStreams); + } + if (CollectiveRingOrder.Length != 0) { + output.WriteRawTag(34); + output.WriteString(CollectiveRingOrder); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += virtualDevices_.CalculateSize(_repeated_virtualDevices_codec); + if (UseUnifiedMemory != false) { + size += 1 + 1; + } + if (NumDevToDevCopyStreams != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumDevToDevCopyStreams); + } + if (CollectiveRingOrder.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CollectiveRingOrder); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Experimental other) { + if (other == null) { + return; + } + virtualDevices_.Add(other.virtualDevices_); + if (other.UseUnifiedMemory != false) { + UseUnifiedMemory = other.UseUnifiedMemory; + } + if (other.NumDevToDevCopyStreams != 0) { + NumDevToDevCopyStreams = other.NumDevToDevCopyStreams; + } + if (other.CollectiveRingOrder.Length != 0) { + CollectiveRingOrder = other.CollectiveRingOrder; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + virtualDevices_.AddEntriesFrom(input, _repeated_virtualDevices_codec); + break; + } + case 16: { + UseUnifiedMemory = input.ReadBool(); + break; + } + case 24: { + NumDevToDevCopyStreams = input.ReadInt32(); + break; + } + case 34: { + CollectiveRingOrder = input.ReadString(); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the Experimental message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + /// + /// Configuration for breaking down a visible GPU into multiple "virtual" + /// devices. + /// + public sealed partial class VirtualDevices : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VirtualDevices()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.GPUOptions.Types.Experimental.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public VirtualDevices() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public VirtualDevices(VirtualDevices other) : this() { + memoryLimitMb_ = other.memoryLimitMb_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public VirtualDevices Clone() { + return new VirtualDevices(this); + } + + /// Field number for the "memory_limit_mb" field. + public const int MemoryLimitMbFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_memoryLimitMb_codec + = pb::FieldCodec.ForFloat(10); + private readonly pbc::RepeatedField memoryLimitMb_ = new pbc::RepeatedField(); + /// + /// Per "virtual" device memory limit, in MB. The number of elements in + /// the list is the number of virtual devices to create on the + /// corresponding visible GPU (see "virtual_devices" below). + /// If empty, it will create single virtual device taking all available + /// memory from the device. + /// + /// For the concept of "visible" and "virtual" GPU, see the comments for + /// "visible_device_list" above for more information. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField MemoryLimitMb { + get { return memoryLimitMb_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as VirtualDevices); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(VirtualDevices other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!memoryLimitMb_.Equals(other.memoryLimitMb_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= memoryLimitMb_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + memoryLimitMb_.WriteTo(output, _repeated_memoryLimitMb_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += memoryLimitMb_.CalculateSize(_repeated_memoryLimitMb_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(VirtualDevices other) { + if (other == null) { + return; + } + memoryLimitMb_.Add(other.memoryLimitMb_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: + case 13: { + memoryLimitMb_.AddEntriesFrom(input, _repeated_memoryLimitMb_codec); + break; + } + } + } + } + + } + + } + #endregion + + } + + } + #endregion + + } + + /// + /// Options passed to the graph optimizer + /// + public sealed partial class OptimizerOptions : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OptimizerOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OptimizerOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OptimizerOptions(OptimizerOptions other) : this() { + doCommonSubexpressionElimination_ = other.doCommonSubexpressionElimination_; + doConstantFolding_ = other.doConstantFolding_; + maxFoldedConstantInBytes_ = other.maxFoldedConstantInBytes_; + doFunctionInlining_ = other.doFunctionInlining_; + optLevel_ = other.optLevel_; + globalJitLevel_ = other.globalJitLevel_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OptimizerOptions Clone() { + return new OptimizerOptions(this); + } + + /// Field number for the "do_common_subexpression_elimination" field. + public const int DoCommonSubexpressionEliminationFieldNumber = 1; + private bool doCommonSubexpressionElimination_; + /// + /// If true, optimize the graph using common subexpression elimination. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool DoCommonSubexpressionElimination { + get { return doCommonSubexpressionElimination_; } + set { + doCommonSubexpressionElimination_ = value; + } + } + + /// Field number for the "do_constant_folding" field. + public const int DoConstantFoldingFieldNumber = 2; + private bool doConstantFolding_; + /// + /// If true, perform constant folding optimization on the graph. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool DoConstantFolding { + get { return doConstantFolding_; } + set { + doConstantFolding_ = value; + } + } + + /// Field number for the "max_folded_constant_in_bytes" field. + public const int MaxFoldedConstantInBytesFieldNumber = 6; + private long maxFoldedConstantInBytes_; + /// + /// Constant folding optimization replaces tensors whose values can be + /// predetermined, with constant nodes. To avoid inserting too large constants, + /// the size of each constant created can be limited. If this value is zero, a + /// default limit of 10 MiB will be applied. If constant folding optimization + /// is disabled, this value is ignored. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long MaxFoldedConstantInBytes { + get { return maxFoldedConstantInBytes_; } + set { + maxFoldedConstantInBytes_ = value; + } + } + + /// Field number for the "do_function_inlining" field. + public const int DoFunctionInliningFieldNumber = 4; + private bool doFunctionInlining_; + /// + /// If true, perform function inlining on the graph. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool DoFunctionInlining { + get { return doFunctionInlining_; } + set { + doFunctionInlining_ = value; + } + } + + /// Field number for the "opt_level" field. + public const int OptLevelFieldNumber = 3; + private global::Tensorflow.OptimizerOptions.Types.Level optLevel_ = 0; + /// + /// Overall optimization level. The actual optimizations applied will be the + /// logical OR of the flags that this level implies and any flags already set. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.OptimizerOptions.Types.Level OptLevel { + get { return optLevel_; } + set { + optLevel_ = value; + } + } + + /// Field number for the "global_jit_level" field. + public const int GlobalJitLevelFieldNumber = 5; + private global::Tensorflow.OptimizerOptions.Types.GlobalJitLevel globalJitLevel_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.OptimizerOptions.Types.GlobalJitLevel GlobalJitLevel { + get { return globalJitLevel_; } + set { + globalJitLevel_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OptimizerOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OptimizerOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (DoCommonSubexpressionElimination != other.DoCommonSubexpressionElimination) return false; + if (DoConstantFolding != other.DoConstantFolding) return false; + if (MaxFoldedConstantInBytes != other.MaxFoldedConstantInBytes) return false; + if (DoFunctionInlining != other.DoFunctionInlining) return false; + if (OptLevel != other.OptLevel) return false; + if (GlobalJitLevel != other.GlobalJitLevel) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (DoCommonSubexpressionElimination != false) hash ^= DoCommonSubexpressionElimination.GetHashCode(); + if (DoConstantFolding != false) hash ^= DoConstantFolding.GetHashCode(); + if (MaxFoldedConstantInBytes != 0L) hash ^= MaxFoldedConstantInBytes.GetHashCode(); + if (DoFunctionInlining != false) hash ^= DoFunctionInlining.GetHashCode(); + if (OptLevel != 0) hash ^= OptLevel.GetHashCode(); + if (GlobalJitLevel != 0) hash ^= GlobalJitLevel.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (DoCommonSubexpressionElimination != false) { + output.WriteRawTag(8); + output.WriteBool(DoCommonSubexpressionElimination); + } + if (DoConstantFolding != false) { + output.WriteRawTag(16); + output.WriteBool(DoConstantFolding); + } + if (OptLevel != 0) { + output.WriteRawTag(24); + output.WriteEnum((int) OptLevel); + } + if (DoFunctionInlining != false) { + output.WriteRawTag(32); + output.WriteBool(DoFunctionInlining); + } + if (GlobalJitLevel != 0) { + output.WriteRawTag(40); + output.WriteEnum((int) GlobalJitLevel); + } + if (MaxFoldedConstantInBytes != 0L) { + output.WriteRawTag(48); + output.WriteInt64(MaxFoldedConstantInBytes); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (DoCommonSubexpressionElimination != false) { + size += 1 + 1; + } + if (DoConstantFolding != false) { + size += 1 + 1; + } + if (MaxFoldedConstantInBytes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(MaxFoldedConstantInBytes); + } + if (DoFunctionInlining != false) { + size += 1 + 1; + } + if (OptLevel != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) OptLevel); + } + if (GlobalJitLevel != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) GlobalJitLevel); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OptimizerOptions other) { + if (other == null) { + return; + } + if (other.DoCommonSubexpressionElimination != false) { + DoCommonSubexpressionElimination = other.DoCommonSubexpressionElimination; + } + if (other.DoConstantFolding != false) { + DoConstantFolding = other.DoConstantFolding; + } + if (other.MaxFoldedConstantInBytes != 0L) { + MaxFoldedConstantInBytes = other.MaxFoldedConstantInBytes; + } + if (other.DoFunctionInlining != false) { + DoFunctionInlining = other.DoFunctionInlining; + } + if (other.OptLevel != 0) { + OptLevel = other.OptLevel; + } + if (other.GlobalJitLevel != 0) { + GlobalJitLevel = other.GlobalJitLevel; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + DoCommonSubexpressionElimination = input.ReadBool(); + break; + } + case 16: { + DoConstantFolding = input.ReadBool(); + break; + } + case 24: { + optLevel_ = (global::Tensorflow.OptimizerOptions.Types.Level) input.ReadEnum(); + break; + } + case 32: { + DoFunctionInlining = input.ReadBool(); + break; + } + case 40: { + globalJitLevel_ = (global::Tensorflow.OptimizerOptions.Types.GlobalJitLevel) input.ReadEnum(); + break; + } + case 48: { + MaxFoldedConstantInBytes = input.ReadInt64(); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the OptimizerOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + /// + /// Optimization level + /// + public enum Level { + /// + /// L1 is the default level. + /// Optimization performed at L1 : + /// 1. Common subexpression elimination + /// 2. Constant folding + /// + [pbr::OriginalName("L1")] L1 = 0, + /// + /// No optimizations + /// + [pbr::OriginalName("L0")] L0 = -1, + } + + /// + /// Control the use of the compiler/jit. Experimental. + /// + public enum GlobalJitLevel { + /// + /// Default setting ("off" now, but later expected to be "on") + /// + [pbr::OriginalName("DEFAULT")] Default = 0, + [pbr::OriginalName("OFF")] Off = -1, + /// + /// The following settings turn on compilation, with higher values being + /// more aggressive. Higher values may reduce opportunities for parallelism + /// and may use more memory. (At present, there is no distinction, but this + /// is expected to change.) + /// + [pbr::OriginalName("ON_1")] On1 = 1, + [pbr::OriginalName("ON_2")] On2 = 2, + } + + } + #endregion + + } + + public sealed partial class GraphOptions : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphOptions(GraphOptions other) : this() { + enableRecvScheduling_ = other.enableRecvScheduling_; + optimizerOptions_ = other.optimizerOptions_ != null ? other.optimizerOptions_.Clone() : null; + buildCostModel_ = other.buildCostModel_; + buildCostModelAfter_ = other.buildCostModelAfter_; + inferShapes_ = other.inferShapes_; + placePrunedGraph_ = other.placePrunedGraph_; + enableBfloat16Sendrecv_ = other.enableBfloat16Sendrecv_; + timelineStep_ = other.timelineStep_; + rewriteOptions_ = other.rewriteOptions_ != null ? other.rewriteOptions_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphOptions Clone() { + return new GraphOptions(this); + } + + /// Field number for the "enable_recv_scheduling" field. + public const int EnableRecvSchedulingFieldNumber = 2; + private bool enableRecvScheduling_; + /// + /// If true, use control flow to schedule the activation of Recv nodes. + /// (Currently ignored.) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool EnableRecvScheduling { + get { return enableRecvScheduling_; } + set { + enableRecvScheduling_ = value; + } + } + + /// Field number for the "optimizer_options" field. + public const int OptimizerOptionsFieldNumber = 3; + private global::Tensorflow.OptimizerOptions optimizerOptions_; + /// + /// Options controlling how graph is optimized. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.OptimizerOptions OptimizerOptions { + get { return optimizerOptions_; } + set { + optimizerOptions_ = value; + } + } + + /// Field number for the "build_cost_model" field. + public const int BuildCostModelFieldNumber = 4; + private long buildCostModel_; + /// + /// The number of steps to run before returning a cost model detailing + /// the memory usage and performance of each node of the graph. 0 means + /// no cost model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long BuildCostModel { + get { return buildCostModel_; } + set { + buildCostModel_ = value; + } + } + + /// Field number for the "build_cost_model_after" field. + public const int BuildCostModelAfterFieldNumber = 9; + private long buildCostModelAfter_; + /// + /// The number of steps to skip before collecting statistics for the + /// cost model. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long BuildCostModelAfter { + get { return buildCostModelAfter_; } + set { + buildCostModelAfter_ = value; + } + } + + /// Field number for the "infer_shapes" field. + public const int InferShapesFieldNumber = 5; + private bool inferShapes_; + /// + /// Annotate each Node with Op output shape data, to the extent it can + /// be statically inferred. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool InferShapes { + get { return inferShapes_; } + set { + inferShapes_ = value; + } + } + + /// Field number for the "place_pruned_graph" field. + public const int PlacePrunedGraphFieldNumber = 6; + private bool placePrunedGraph_; + /// + /// Only place the subgraphs that are run, rather than the entire graph. + /// + /// This is useful for interactive graph building, where one might + /// produce graphs that cannot be placed during the debugging + /// process. In particular, it allows the client to continue work in + /// a session after adding a node to a graph whose placement + /// constraints are unsatisfiable. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool PlacePrunedGraph { + get { return placePrunedGraph_; } + set { + placePrunedGraph_ = value; + } + } + + /// Field number for the "enable_bfloat16_sendrecv" field. + public const int EnableBfloat16SendrecvFieldNumber = 7; + private bool enableBfloat16Sendrecv_; + /// + /// If true, transfer float values between processes as bfloat16. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool EnableBfloat16Sendrecv { + get { return enableBfloat16Sendrecv_; } + set { + enableBfloat16Sendrecv_ = value; + } + } + + /// Field number for the "timeline_step" field. + public const int TimelineStepFieldNumber = 8; + private int timelineStep_; + /// + /// If > 0, record a timeline every this many steps. + /// EXPERIMENTAL: This currently has no effect in MasterSession. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TimelineStep { + get { return timelineStep_; } + set { + timelineStep_ = value; + } + } + + /// Field number for the "rewrite_options" field. + public const int RewriteOptionsFieldNumber = 10; + private global::Tensorflow.RewriterConfig rewriteOptions_; + /// + /// Options that control the type and amount of graph rewriting. + /// Not currently configurable via the public Python API (i.e. there is no API + /// stability guarantee if you import RewriterConfig explicitly). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig RewriteOptions { + get { return rewriteOptions_; } + set { + rewriteOptions_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GraphOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GraphOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (EnableRecvScheduling != other.EnableRecvScheduling) return false; + if (!object.Equals(OptimizerOptions, other.OptimizerOptions)) return false; + if (BuildCostModel != other.BuildCostModel) return false; + if (BuildCostModelAfter != other.BuildCostModelAfter) return false; + if (InferShapes != other.InferShapes) return false; + if (PlacePrunedGraph != other.PlacePrunedGraph) return false; + if (EnableBfloat16Sendrecv != other.EnableBfloat16Sendrecv) return false; + if (TimelineStep != other.TimelineStep) return false; + if (!object.Equals(RewriteOptions, other.RewriteOptions)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (EnableRecvScheduling != false) hash ^= EnableRecvScheduling.GetHashCode(); + if (optimizerOptions_ != null) hash ^= OptimizerOptions.GetHashCode(); + if (BuildCostModel != 0L) hash ^= BuildCostModel.GetHashCode(); + if (BuildCostModelAfter != 0L) hash ^= BuildCostModelAfter.GetHashCode(); + if (InferShapes != false) hash ^= InferShapes.GetHashCode(); + if (PlacePrunedGraph != false) hash ^= PlacePrunedGraph.GetHashCode(); + if (EnableBfloat16Sendrecv != false) hash ^= EnableBfloat16Sendrecv.GetHashCode(); + if (TimelineStep != 0) hash ^= TimelineStep.GetHashCode(); + if (rewriteOptions_ != null) hash ^= RewriteOptions.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (EnableRecvScheduling != false) { + output.WriteRawTag(16); + output.WriteBool(EnableRecvScheduling); + } + if (optimizerOptions_ != null) { + output.WriteRawTag(26); + output.WriteMessage(OptimizerOptions); + } + if (BuildCostModel != 0L) { + output.WriteRawTag(32); + output.WriteInt64(BuildCostModel); + } + if (InferShapes != false) { + output.WriteRawTag(40); + output.WriteBool(InferShapes); + } + if (PlacePrunedGraph != false) { + output.WriteRawTag(48); + output.WriteBool(PlacePrunedGraph); + } + if (EnableBfloat16Sendrecv != false) { + output.WriteRawTag(56); + output.WriteBool(EnableBfloat16Sendrecv); + } + if (TimelineStep != 0) { + output.WriteRawTag(64); + output.WriteInt32(TimelineStep); + } + if (BuildCostModelAfter != 0L) { + output.WriteRawTag(72); + output.WriteInt64(BuildCostModelAfter); + } + if (rewriteOptions_ != null) { + output.WriteRawTag(82); + output.WriteMessage(RewriteOptions); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (EnableRecvScheduling != false) { + size += 1 + 1; + } + if (optimizerOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(OptimizerOptions); + } + if (BuildCostModel != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BuildCostModel); + } + if (BuildCostModelAfter != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(BuildCostModelAfter); + } + if (InferShapes != false) { + size += 1 + 1; + } + if (PlacePrunedGraph != false) { + size += 1 + 1; + } + if (EnableBfloat16Sendrecv != false) { + size += 1 + 1; + } + if (TimelineStep != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TimelineStep); + } + if (rewriteOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RewriteOptions); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GraphOptions other) { + if (other == null) { + return; + } + if (other.EnableRecvScheduling != false) { + EnableRecvScheduling = other.EnableRecvScheduling; + } + if (other.optimizerOptions_ != null) { + if (optimizerOptions_ == null) { + optimizerOptions_ = new global::Tensorflow.OptimizerOptions(); + } + OptimizerOptions.MergeFrom(other.OptimizerOptions); + } + if (other.BuildCostModel != 0L) { + BuildCostModel = other.BuildCostModel; + } + if (other.BuildCostModelAfter != 0L) { + BuildCostModelAfter = other.BuildCostModelAfter; + } + if (other.InferShapes != false) { + InferShapes = other.InferShapes; + } + if (other.PlacePrunedGraph != false) { + PlacePrunedGraph = other.PlacePrunedGraph; + } + if (other.EnableBfloat16Sendrecv != false) { + EnableBfloat16Sendrecv = other.EnableBfloat16Sendrecv; + } + if (other.TimelineStep != 0) { + TimelineStep = other.TimelineStep; + } + if (other.rewriteOptions_ != null) { + if (rewriteOptions_ == null) { + rewriteOptions_ = new global::Tensorflow.RewriterConfig(); + } + RewriteOptions.MergeFrom(other.RewriteOptions); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 16: { + EnableRecvScheduling = input.ReadBool(); + break; + } + case 26: { + if (optimizerOptions_ == null) { + optimizerOptions_ = new global::Tensorflow.OptimizerOptions(); + } + input.ReadMessage(optimizerOptions_); + break; + } + case 32: { + BuildCostModel = input.ReadInt64(); + break; + } + case 40: { + InferShapes = input.ReadBool(); + break; + } + case 48: { + PlacePrunedGraph = input.ReadBool(); + break; + } + case 56: { + EnableBfloat16Sendrecv = input.ReadBool(); + break; + } + case 64: { + TimelineStep = input.ReadInt32(); + break; + } + case 72: { + BuildCostModelAfter = input.ReadInt64(); + break; + } + case 82: { + if (rewriteOptions_ == null) { + rewriteOptions_ = new global::Tensorflow.RewriterConfig(); + } + input.ReadMessage(rewriteOptions_); + break; + } + } + } + } + + } + + public sealed partial class ThreadPoolOptionProto : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ThreadPoolOptionProto()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ThreadPoolOptionProto() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ThreadPoolOptionProto(ThreadPoolOptionProto other) : this() { + numThreads_ = other.numThreads_; + globalName_ = other.globalName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ThreadPoolOptionProto Clone() { + return new ThreadPoolOptionProto(this); + } + + /// Field number for the "num_threads" field. + public const int NumThreadsFieldNumber = 1; + private int numThreads_; + /// + /// The number of threads in the pool. + /// + /// 0 means the system picks a value based on where this option proto is used + /// (see the declaration of the specific field for more info). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int NumThreads { + get { return numThreads_; } + set { + numThreads_ = value; + } + } + + /// Field number for the "global_name" field. + public const int GlobalNameFieldNumber = 2; + private string globalName_ = ""; + /// + /// The global name of the threadpool. + /// + /// If empty, then the threadpool is made and used according to the scope it's + /// in - e.g., for a session threadpool, it is used by that session only. + /// + /// If non-empty, then: + /// - a global threadpool associated with this name is looked + /// up or created. This allows, for example, sharing one threadpool across + /// many sessions (e.g., like the default behavior, if + /// inter_op_parallelism_threads is not configured), but still partitioning + /// into a large and small pool. + /// - if the threadpool for this global_name already exists, then it is an + /// error if the existing pool was created using a different num_threads + /// value as is specified on this call. + /// - threadpools created this way are never garbage collected. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string GlobalName { + get { return globalName_; } + set { + globalName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ThreadPoolOptionProto); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ThreadPoolOptionProto other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NumThreads != other.NumThreads) return false; + if (GlobalName != other.GlobalName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (NumThreads != 0) hash ^= NumThreads.GetHashCode(); + if (GlobalName.Length != 0) hash ^= GlobalName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (NumThreads != 0) { + output.WriteRawTag(8); + output.WriteInt32(NumThreads); + } + if (GlobalName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(GlobalName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (NumThreads != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumThreads); + } + if (GlobalName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(GlobalName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ThreadPoolOptionProto other) { + if (other == null) { + return; + } + if (other.NumThreads != 0) { + NumThreads = other.NumThreads; + } + if (other.GlobalName.Length != 0) { + GlobalName = other.GlobalName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NumThreads = input.ReadInt32(); + break; + } + case 18: { + GlobalName = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class RPCOptions : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RPCOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RPCOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RPCOptions(RPCOptions other) : this() { + useRpcForInprocessMaster_ = other.useRpcForInprocessMaster_; + compressionAlgorithm_ = other.compressionAlgorithm_; + compressionLevel_ = other.compressionLevel_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RPCOptions Clone() { + return new RPCOptions(this); + } + + /// Field number for the "use_rpc_for_inprocess_master" field. + public const int UseRpcForInprocessMasterFieldNumber = 1; + private bool useRpcForInprocessMaster_; + /// + /// If true, always use RPC to contact the session target. + /// + /// If false (the default option), TensorFlow may use an optimized + /// transport for client-master communication that avoids the RPC + /// stack. This option is primarily for used testing the RPC stack. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool UseRpcForInprocessMaster { + get { return useRpcForInprocessMaster_; } + set { + useRpcForInprocessMaster_ = value; + } + } + + /// Field number for the "compression_algorithm" field. + public const int CompressionAlgorithmFieldNumber = 2; + private string compressionAlgorithm_ = ""; + /// + /// The compression algorithm to be used. One of "deflate", "gzip". + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string CompressionAlgorithm { + get { return compressionAlgorithm_; } + set { + compressionAlgorithm_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "compression_level" field. + public const int CompressionLevelFieldNumber = 3; + private int compressionLevel_; + /// + /// If compression_algorithm is set, the compression level to be used. + /// From 0 (no compression), up to 3. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CompressionLevel { + get { return compressionLevel_; } + set { + compressionLevel_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RPCOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RPCOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UseRpcForInprocessMaster != other.UseRpcForInprocessMaster) return false; + if (CompressionAlgorithm != other.CompressionAlgorithm) return false; + if (CompressionLevel != other.CompressionLevel) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (UseRpcForInprocessMaster != false) hash ^= UseRpcForInprocessMaster.GetHashCode(); + if (CompressionAlgorithm.Length != 0) hash ^= CompressionAlgorithm.GetHashCode(); + if (CompressionLevel != 0) hash ^= CompressionLevel.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (UseRpcForInprocessMaster != false) { + output.WriteRawTag(8); + output.WriteBool(UseRpcForInprocessMaster); + } + if (CompressionAlgorithm.Length != 0) { + output.WriteRawTag(18); + output.WriteString(CompressionAlgorithm); + } + if (CompressionLevel != 0) { + output.WriteRawTag(24); + output.WriteInt32(CompressionLevel); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (UseRpcForInprocessMaster != false) { + size += 1 + 1; + } + if (CompressionAlgorithm.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CompressionAlgorithm); + } + if (CompressionLevel != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(CompressionLevel); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RPCOptions other) { + if (other == null) { + return; + } + if (other.UseRpcForInprocessMaster != false) { + UseRpcForInprocessMaster = other.UseRpcForInprocessMaster; + } + if (other.CompressionAlgorithm.Length != 0) { + CompressionAlgorithm = other.CompressionAlgorithm; + } + if (other.CompressionLevel != 0) { + CompressionLevel = other.CompressionLevel; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + UseRpcForInprocessMaster = input.ReadBool(); + break; + } + case 18: { + CompressionAlgorithm = input.ReadString(); + break; + } + case 24: { + CompressionLevel = input.ReadInt32(); + break; + } + } + } + } + + } + + /// + /// Session configuration parameters. + /// The system picks appropriate values for fields that are not set. + /// + public sealed partial class ConfigProto : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConfigProto()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ConfigProto() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ConfigProto(ConfigProto other) : this() { + deviceCount_ = other.deviceCount_.Clone(); + intraOpParallelismThreads_ = other.intraOpParallelismThreads_; + interOpParallelismThreads_ = other.interOpParallelismThreads_; + usePerSessionThreads_ = other.usePerSessionThreads_; + sessionInterOpThreadPool_ = other.sessionInterOpThreadPool_.Clone(); + placementPeriod_ = other.placementPeriod_; + deviceFilters_ = other.deviceFilters_.Clone(); + gpuOptions_ = other.gpuOptions_ != null ? other.gpuOptions_.Clone() : null; + allowSoftPlacement_ = other.allowSoftPlacement_; + logDevicePlacement_ = other.logDevicePlacement_; + graphOptions_ = other.graphOptions_ != null ? other.graphOptions_.Clone() : null; + operationTimeoutInMs_ = other.operationTimeoutInMs_; + rpcOptions_ = other.rpcOptions_ != null ? other.rpcOptions_.Clone() : null; + clusterDef_ = other.clusterDef_ != null ? other.clusterDef_.Clone() : null; + isolateSessionState_ = other.isolateSessionState_; + experimental_ = other.experimental_ != null ? other.experimental_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ConfigProto Clone() { + return new ConfigProto(this); + } + + /// Field number for the "device_count" field. + public const int DeviceCountFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_deviceCount_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForInt32(16), 10); + private readonly pbc::MapField deviceCount_ = new pbc::MapField(); + /// + /// Map from device type name (e.g., "CPU" or "GPU" ) to maximum + /// number of devices of that type to use. If a particular device + /// type is not found in the map, the system picks an appropriate + /// number. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField DeviceCount { + get { return deviceCount_; } + } + + /// Field number for the "intra_op_parallelism_threads" field. + public const int IntraOpParallelismThreadsFieldNumber = 2; + private int intraOpParallelismThreads_; + /// + /// The execution of an individual op (for some op types) can be + /// parallelized on a pool of intra_op_parallelism_threads. + /// 0 means the system picks an appropriate number. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IntraOpParallelismThreads { + get { return intraOpParallelismThreads_; } + set { + intraOpParallelismThreads_ = value; + } + } + + /// Field number for the "inter_op_parallelism_threads" field. + public const int InterOpParallelismThreadsFieldNumber = 5; + private int interOpParallelismThreads_; + /// + /// Nodes that perform blocking operations are enqueued on a pool of + /// inter_op_parallelism_threads available in each process. + /// + /// 0 means the system picks an appropriate number. + /// + /// Note that the first Session created in the process sets the + /// number of threads for all future sessions unless use_per_session_threads is + /// true or session_inter_op_thread_pool is configured. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int InterOpParallelismThreads { + get { return interOpParallelismThreads_; } + set { + interOpParallelismThreads_ = value; + } + } + + /// Field number for the "use_per_session_threads" field. + public const int UsePerSessionThreadsFieldNumber = 9; + private bool usePerSessionThreads_; + /// + /// If true, use a new set of threads for this session rather than the global + /// pool of threads. Only supported by direct sessions. + /// + /// If false, use the global threads created by the first session, or the + /// per-session thread pools configured by session_inter_op_thread_pool. + /// + /// This option is deprecated. The same effect can be achieved by setting + /// session_inter_op_thread_pool to have one element, whose num_threads equals + /// inter_op_parallelism_threads. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool UsePerSessionThreads { + get { return usePerSessionThreads_; } + set { + usePerSessionThreads_ = value; + } + } + + /// Field number for the "session_inter_op_thread_pool" field. + public const int SessionInterOpThreadPoolFieldNumber = 12; + private static readonly pb::FieldCodec _repeated_sessionInterOpThreadPool_codec + = pb::FieldCodec.ForMessage(98, global::Tensorflow.ThreadPoolOptionProto.Parser); + private readonly pbc::RepeatedField sessionInterOpThreadPool_ = new pbc::RepeatedField(); + /// + /// This option is experimental - it may be replaced with a different mechanism + /// in the future. + /// + /// Configures session thread pools. If this is configured, then RunOptions for + /// a Run call can select the thread pool to use. + /// + /// The intended use is for when some session invocations need to run in a + /// background pool limited to a small number of threads: + /// - For example, a session may be configured to have one large pool (for + /// regular compute) and one small pool (for periodic, low priority work); + /// using the small pool is currently the mechanism for limiting the inter-op + /// parallelism of the low priority work. Note that it does not limit the + /// parallelism of work spawned by a single op kernel implementation. + /// - Using this setting is normally not needed in training, but may help some + /// serving use cases. + /// - It is also generally recommended to set the global_name field of this + /// proto, to avoid creating multiple large pools. It is typically better to + /// run the non-low-priority work, even across sessions, in a single large + /// pool. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField SessionInterOpThreadPool { + get { return sessionInterOpThreadPool_; } + } + + /// Field number for the "placement_period" field. + public const int PlacementPeriodFieldNumber = 3; + private int placementPeriod_; + /// + /// Assignment of Nodes to Devices is recomputed every placement_period + /// steps until the system warms up (at which point the recomputation + /// typically slows down automatically). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PlacementPeriod { + get { return placementPeriod_; } + set { + placementPeriod_ = value; + } + } + + /// Field number for the "device_filters" field. + public const int DeviceFiltersFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_deviceFilters_codec + = pb::FieldCodec.ForString(34); + private readonly pbc::RepeatedField deviceFilters_ = new pbc::RepeatedField(); + /// + /// When any filters are present sessions will ignore all devices which do not + /// match the filters. Each filter can be partially specified, e.g. "/job:ps" + /// "/job:worker/replica:3", etc. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DeviceFilters { + get { return deviceFilters_; } + } + + /// Field number for the "gpu_options" field. + public const int GpuOptionsFieldNumber = 6; + private global::Tensorflow.GPUOptions gpuOptions_; + /// + /// Options that apply to all GPUs. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.GPUOptions GpuOptions { + get { return gpuOptions_; } + set { + gpuOptions_ = value; + } + } + + /// Field number for the "allow_soft_placement" field. + public const int AllowSoftPlacementFieldNumber = 7; + private bool allowSoftPlacement_; + /// + /// Whether soft placement is allowed. If allow_soft_placement is true, + /// an op will be placed on CPU if + /// 1. there's no GPU implementation for the OP + /// or + /// 2. no GPU devices are known or registered + /// or + /// 3. need to co-locate with reftype input(s) which are from CPU. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool AllowSoftPlacement { + get { return allowSoftPlacement_; } + set { + allowSoftPlacement_ = value; + } + } + + /// Field number for the "log_device_placement" field. + public const int LogDevicePlacementFieldNumber = 8; + private bool logDevicePlacement_; + /// + /// Whether device placements should be logged. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool LogDevicePlacement { + get { return logDevicePlacement_; } + set { + logDevicePlacement_ = value; + } + } + + /// Field number for the "graph_options" field. + public const int GraphOptionsFieldNumber = 10; + private global::Tensorflow.GraphOptions graphOptions_; + /// + /// Options that apply to all graphs. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.GraphOptions GraphOptions { + get { return graphOptions_; } + set { + graphOptions_ = value; + } + } + + /// Field number for the "operation_timeout_in_ms" field. + public const int OperationTimeoutInMsFieldNumber = 11; + private long operationTimeoutInMs_; + /// + /// Global timeout for all blocking operations in this session. If non-zero, + /// and not overridden on a per-operation basis, this value will be used as the + /// deadline for all blocking operations. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long OperationTimeoutInMs { + get { return operationTimeoutInMs_; } + set { + operationTimeoutInMs_ = value; + } + } + + /// Field number for the "rpc_options" field. + public const int RpcOptionsFieldNumber = 13; + private global::Tensorflow.RPCOptions rpcOptions_; + /// + /// Options that apply when this session uses the distributed runtime. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RPCOptions RpcOptions { + get { return rpcOptions_; } + set { + rpcOptions_ = value; + } + } + + /// Field number for the "cluster_def" field. + public const int ClusterDefFieldNumber = 14; + private global::Tensorflow.ClusterDef clusterDef_; + /// + /// Optional list of all workers to use in this session. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.ClusterDef ClusterDef { + get { return clusterDef_; } + set { + clusterDef_ = value; + } + } + + /// Field number for the "isolate_session_state" field. + public const int IsolateSessionStateFieldNumber = 15; + private bool isolateSessionState_; + /// + /// If true, any resources such as Variables used in the session will not be + /// shared with other sessions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsolateSessionState { + get { return isolateSessionState_; } + set { + isolateSessionState_ = value; + } + } + + /// Field number for the "experimental" field. + public const int ExperimentalFieldNumber = 16; + private global::Tensorflow.ConfigProto.Types.Experimental experimental_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.ConfigProto.Types.Experimental Experimental { + get { return experimental_; } + set { + experimental_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ConfigProto); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ConfigProto other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!DeviceCount.Equals(other.DeviceCount)) return false; + if (IntraOpParallelismThreads != other.IntraOpParallelismThreads) return false; + if (InterOpParallelismThreads != other.InterOpParallelismThreads) return false; + if (UsePerSessionThreads != other.UsePerSessionThreads) return false; + if(!sessionInterOpThreadPool_.Equals(other.sessionInterOpThreadPool_)) return false; + if (PlacementPeriod != other.PlacementPeriod) return false; + if(!deviceFilters_.Equals(other.deviceFilters_)) return false; + if (!object.Equals(GpuOptions, other.GpuOptions)) return false; + if (AllowSoftPlacement != other.AllowSoftPlacement) return false; + if (LogDevicePlacement != other.LogDevicePlacement) return false; + if (!object.Equals(GraphOptions, other.GraphOptions)) return false; + if (OperationTimeoutInMs != other.OperationTimeoutInMs) return false; + if (!object.Equals(RpcOptions, other.RpcOptions)) return false; + if (!object.Equals(ClusterDef, other.ClusterDef)) return false; + if (IsolateSessionState != other.IsolateSessionState) return false; + if (!object.Equals(Experimental, other.Experimental)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= DeviceCount.GetHashCode(); + if (IntraOpParallelismThreads != 0) hash ^= IntraOpParallelismThreads.GetHashCode(); + if (InterOpParallelismThreads != 0) hash ^= InterOpParallelismThreads.GetHashCode(); + if (UsePerSessionThreads != false) hash ^= UsePerSessionThreads.GetHashCode(); + hash ^= sessionInterOpThreadPool_.GetHashCode(); + if (PlacementPeriod != 0) hash ^= PlacementPeriod.GetHashCode(); + hash ^= deviceFilters_.GetHashCode(); + if (gpuOptions_ != null) hash ^= GpuOptions.GetHashCode(); + if (AllowSoftPlacement != false) hash ^= AllowSoftPlacement.GetHashCode(); + if (LogDevicePlacement != false) hash ^= LogDevicePlacement.GetHashCode(); + if (graphOptions_ != null) hash ^= GraphOptions.GetHashCode(); + if (OperationTimeoutInMs != 0L) hash ^= OperationTimeoutInMs.GetHashCode(); + if (rpcOptions_ != null) hash ^= RpcOptions.GetHashCode(); + if (clusterDef_ != null) hash ^= ClusterDef.GetHashCode(); + if (IsolateSessionState != false) hash ^= IsolateSessionState.GetHashCode(); + if (experimental_ != null) hash ^= Experimental.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + deviceCount_.WriteTo(output, _map_deviceCount_codec); + if (IntraOpParallelismThreads != 0) { + output.WriteRawTag(16); + output.WriteInt32(IntraOpParallelismThreads); + } + if (PlacementPeriod != 0) { + output.WriteRawTag(24); + output.WriteInt32(PlacementPeriod); + } + deviceFilters_.WriteTo(output, _repeated_deviceFilters_codec); + if (InterOpParallelismThreads != 0) { + output.WriteRawTag(40); + output.WriteInt32(InterOpParallelismThreads); + } + if (gpuOptions_ != null) { + output.WriteRawTag(50); + output.WriteMessage(GpuOptions); + } + if (AllowSoftPlacement != false) { + output.WriteRawTag(56); + output.WriteBool(AllowSoftPlacement); + } + if (LogDevicePlacement != false) { + output.WriteRawTag(64); + output.WriteBool(LogDevicePlacement); + } + if (UsePerSessionThreads != false) { + output.WriteRawTag(72); + output.WriteBool(UsePerSessionThreads); + } + if (graphOptions_ != null) { + output.WriteRawTag(82); + output.WriteMessage(GraphOptions); + } + if (OperationTimeoutInMs != 0L) { + output.WriteRawTag(88); + output.WriteInt64(OperationTimeoutInMs); + } + sessionInterOpThreadPool_.WriteTo(output, _repeated_sessionInterOpThreadPool_codec); + if (rpcOptions_ != null) { + output.WriteRawTag(106); + output.WriteMessage(RpcOptions); + } + if (clusterDef_ != null) { + output.WriteRawTag(114); + output.WriteMessage(ClusterDef); + } + if (IsolateSessionState != false) { + output.WriteRawTag(120); + output.WriteBool(IsolateSessionState); + } + if (experimental_ != null) { + output.WriteRawTag(130, 1); + output.WriteMessage(Experimental); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += deviceCount_.CalculateSize(_map_deviceCount_codec); + if (IntraOpParallelismThreads != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntraOpParallelismThreads); + } + if (InterOpParallelismThreads != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InterOpParallelismThreads); + } + if (UsePerSessionThreads != false) { + size += 1 + 1; + } + size += sessionInterOpThreadPool_.CalculateSize(_repeated_sessionInterOpThreadPool_codec); + if (PlacementPeriod != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PlacementPeriod); + } + size += deviceFilters_.CalculateSize(_repeated_deviceFilters_codec); + if (gpuOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GpuOptions); + } + if (AllowSoftPlacement != false) { + size += 1 + 1; + } + if (LogDevicePlacement != false) { + size += 1 + 1; + } + if (graphOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(GraphOptions); + } + if (OperationTimeoutInMs != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(OperationTimeoutInMs); + } + if (rpcOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RpcOptions); + } + if (clusterDef_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClusterDef); + } + if (IsolateSessionState != false) { + size += 1 + 1; + } + if (experimental_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(Experimental); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ConfigProto other) { + if (other == null) { + return; + } + deviceCount_.Add(other.deviceCount_); + if (other.IntraOpParallelismThreads != 0) { + IntraOpParallelismThreads = other.IntraOpParallelismThreads; + } + if (other.InterOpParallelismThreads != 0) { + InterOpParallelismThreads = other.InterOpParallelismThreads; + } + if (other.UsePerSessionThreads != false) { + UsePerSessionThreads = other.UsePerSessionThreads; + } + sessionInterOpThreadPool_.Add(other.sessionInterOpThreadPool_); + if (other.PlacementPeriod != 0) { + PlacementPeriod = other.PlacementPeriod; + } + deviceFilters_.Add(other.deviceFilters_); + if (other.gpuOptions_ != null) { + if (gpuOptions_ == null) { + gpuOptions_ = new global::Tensorflow.GPUOptions(); + } + GpuOptions.MergeFrom(other.GpuOptions); + } + if (other.AllowSoftPlacement != false) { + AllowSoftPlacement = other.AllowSoftPlacement; + } + if (other.LogDevicePlacement != false) { + LogDevicePlacement = other.LogDevicePlacement; + } + if (other.graphOptions_ != null) { + if (graphOptions_ == null) { + graphOptions_ = new global::Tensorflow.GraphOptions(); + } + GraphOptions.MergeFrom(other.GraphOptions); + } + if (other.OperationTimeoutInMs != 0L) { + OperationTimeoutInMs = other.OperationTimeoutInMs; + } + if (other.rpcOptions_ != null) { + if (rpcOptions_ == null) { + rpcOptions_ = new global::Tensorflow.RPCOptions(); + } + RpcOptions.MergeFrom(other.RpcOptions); + } + if (other.clusterDef_ != null) { + if (clusterDef_ == null) { + clusterDef_ = new global::Tensorflow.ClusterDef(); + } + ClusterDef.MergeFrom(other.ClusterDef); + } + if (other.IsolateSessionState != false) { + IsolateSessionState = other.IsolateSessionState; + } + if (other.experimental_ != null) { + if (experimental_ == null) { + experimental_ = new global::Tensorflow.ConfigProto.Types.Experimental(); + } + Experimental.MergeFrom(other.Experimental); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + deviceCount_.AddEntriesFrom(input, _map_deviceCount_codec); + break; + } + case 16: { + IntraOpParallelismThreads = input.ReadInt32(); + break; + } + case 24: { + PlacementPeriod = input.ReadInt32(); + break; + } + case 34: { + deviceFilters_.AddEntriesFrom(input, _repeated_deviceFilters_codec); + break; + } + case 40: { + InterOpParallelismThreads = input.ReadInt32(); + break; + } + case 50: { + if (gpuOptions_ == null) { + gpuOptions_ = new global::Tensorflow.GPUOptions(); + } + input.ReadMessage(gpuOptions_); + break; + } + case 56: { + AllowSoftPlacement = input.ReadBool(); + break; + } + case 64: { + LogDevicePlacement = input.ReadBool(); + break; + } + case 72: { + UsePerSessionThreads = input.ReadBool(); + break; + } + case 82: { + if (graphOptions_ == null) { + graphOptions_ = new global::Tensorflow.GraphOptions(); + } + input.ReadMessage(graphOptions_); + break; + } + case 88: { + OperationTimeoutInMs = input.ReadInt64(); + break; + } + case 98: { + sessionInterOpThreadPool_.AddEntriesFrom(input, _repeated_sessionInterOpThreadPool_codec); + break; + } + case 106: { + if (rpcOptions_ == null) { + rpcOptions_ = new global::Tensorflow.RPCOptions(); + } + input.ReadMessage(rpcOptions_); + break; + } + case 114: { + if (clusterDef_ == null) { + clusterDef_ = new global::Tensorflow.ClusterDef(); + } + input.ReadMessage(clusterDef_); + break; + } + case 120: { + IsolateSessionState = input.ReadBool(); + break; + } + case 130: { + if (experimental_ == null) { + experimental_ = new global::Tensorflow.ConfigProto.Types.Experimental(); + } + input.ReadMessage(experimental_); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the ConfigProto message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + /// + /// Everything inside Experimental is subject to change and is not subject + /// to API stability guarantees in + /// https://www.tensorflow.org/guide/version_compat. + /// + public sealed partial class Experimental : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Experimental()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigProto.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Experimental() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Experimental(Experimental other) : this() { + collectiveGroupLeader_ = other.collectiveGroupLeader_; + executorType_ = other.executorType_; + recvBufMaxChunk_ = other.recvBufMaxChunk_; + useNumaAffinity_ = other.useNumaAffinity_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Experimental Clone() { + return new Experimental(this); + } + + /// Field number for the "collective_group_leader" field. + public const int CollectiveGroupLeaderFieldNumber = 1; + private string collectiveGroupLeader_ = ""; + /// + /// Task name for group resolution. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string CollectiveGroupLeader { + get { return collectiveGroupLeader_; } + set { + collectiveGroupLeader_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "executor_type" field. + public const int ExecutorTypeFieldNumber = 3; + private string executorType_ = ""; + /// + /// Which executor to use, the default executor will be used + /// if it is an empty string or "DEFAULT" + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ExecutorType { + get { return executorType_; } + set { + executorType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "recv_buf_max_chunk" field. + public const int RecvBufMaxChunkFieldNumber = 4; + private int recvBufMaxChunk_; + /// + /// Guidance to formatting of large RecvBuf fields for transfer. + /// Any positive value sets the max chunk size. 0 defaults to 4096. + /// Any negative value indicates no max, i.e. one chunk only. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int RecvBufMaxChunk { + get { return recvBufMaxChunk_; } + set { + recvBufMaxChunk_ = value; + } + } + + /// Field number for the "use_numa_affinity" field. + public const int UseNumaAffinityFieldNumber = 5; + private bool useNumaAffinity_; + /// + /// If true, and supported by the platform, the runtime will attempt to + /// use NUMA affinity where applicable. One consequence will be the + /// existence of as many CPU devices as there are available NUMA nodes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool UseNumaAffinity { + get { return useNumaAffinity_; } + set { + useNumaAffinity_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Experimental); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Experimental other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CollectiveGroupLeader != other.CollectiveGroupLeader) return false; + if (ExecutorType != other.ExecutorType) return false; + if (RecvBufMaxChunk != other.RecvBufMaxChunk) return false; + if (UseNumaAffinity != other.UseNumaAffinity) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (CollectiveGroupLeader.Length != 0) hash ^= CollectiveGroupLeader.GetHashCode(); + if (ExecutorType.Length != 0) hash ^= ExecutorType.GetHashCode(); + if (RecvBufMaxChunk != 0) hash ^= RecvBufMaxChunk.GetHashCode(); + if (UseNumaAffinity != false) hash ^= UseNumaAffinity.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (CollectiveGroupLeader.Length != 0) { + output.WriteRawTag(10); + output.WriteString(CollectiveGroupLeader); + } + if (ExecutorType.Length != 0) { + output.WriteRawTag(26); + output.WriteString(ExecutorType); + } + if (RecvBufMaxChunk != 0) { + output.WriteRawTag(32); + output.WriteInt32(RecvBufMaxChunk); + } + if (UseNumaAffinity != false) { + output.WriteRawTag(40); + output.WriteBool(UseNumaAffinity); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (CollectiveGroupLeader.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(CollectiveGroupLeader); + } + if (ExecutorType.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ExecutorType); + } + if (RecvBufMaxChunk != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RecvBufMaxChunk); + } + if (UseNumaAffinity != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Experimental other) { + if (other == null) { + return; + } + if (other.CollectiveGroupLeader.Length != 0) { + CollectiveGroupLeader = other.CollectiveGroupLeader; + } + if (other.ExecutorType.Length != 0) { + ExecutorType = other.ExecutorType; + } + if (other.RecvBufMaxChunk != 0) { + RecvBufMaxChunk = other.RecvBufMaxChunk; + } + if (other.UseNumaAffinity != false) { + UseNumaAffinity = other.UseNumaAffinity; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + CollectiveGroupLeader = input.ReadString(); + break; + } + case 26: { + ExecutorType = input.ReadString(); + break; + } + case 32: { + RecvBufMaxChunk = input.ReadInt32(); + break; + } + case 40: { + UseNumaAffinity = input.ReadBool(); + break; + } + } + } + } + + } + + } + #endregion + + } + + /// + /// Options for a single Run() call. + /// + public sealed partial class RunOptions : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RunOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RunOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RunOptions(RunOptions other) : this() { + traceLevel_ = other.traceLevel_; + timeoutInMs_ = other.timeoutInMs_; + interOpThreadPool_ = other.interOpThreadPool_; + outputPartitionGraphs_ = other.outputPartitionGraphs_; + debugOptions_ = other.debugOptions_ != null ? other.debugOptions_.Clone() : null; + reportTensorAllocationsUponOom_ = other.reportTensorAllocationsUponOom_; + experimental_ = other.experimental_ != null ? other.experimental_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RunOptions Clone() { + return new RunOptions(this); + } + + /// Field number for the "trace_level" field. + public const int TraceLevelFieldNumber = 1; + private global::Tensorflow.RunOptions.Types.TraceLevel traceLevel_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RunOptions.Types.TraceLevel TraceLevel { + get { return traceLevel_; } + set { + traceLevel_ = value; + } + } + + /// Field number for the "timeout_in_ms" field. + public const int TimeoutInMsFieldNumber = 2; + private long timeoutInMs_; + /// + /// Time to wait for operation to complete in milliseconds. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long TimeoutInMs { + get { return timeoutInMs_; } + set { + timeoutInMs_ = value; + } + } + + /// Field number for the "inter_op_thread_pool" field. + public const int InterOpThreadPoolFieldNumber = 3; + private int interOpThreadPool_; + /// + /// The thread pool to use, if session_inter_op_thread_pool is configured. + /// To use the caller thread set this to -1 - this uses the caller thread + /// to execute Session::Run() and thus avoids a context switch. Using the + /// caller thread to execute Session::Run() should be done ONLY for simple + /// graphs, where the overhead of an additional context switch is + /// comparable with the overhead of Session::Run(). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int InterOpThreadPool { + get { return interOpThreadPool_; } + set { + interOpThreadPool_ = value; + } + } + + /// Field number for the "output_partition_graphs" field. + public const int OutputPartitionGraphsFieldNumber = 5; + private bool outputPartitionGraphs_; + /// + /// Whether the partition graph(s) executed by the executor(s) should be + /// outputted via RunMetadata. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool OutputPartitionGraphs { + get { return outputPartitionGraphs_; } + set { + outputPartitionGraphs_ = value; + } + } + + /// Field number for the "debug_options" field. + public const int DebugOptionsFieldNumber = 6; + private global::Tensorflow.DebugOptions debugOptions_; + /// + /// EXPERIMENTAL. Options used to initialize DebuggerState, if enabled. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.DebugOptions DebugOptions { + get { return debugOptions_; } + set { + debugOptions_ = value; + } + } + + /// Field number for the "report_tensor_allocations_upon_oom" field. + public const int ReportTensorAllocationsUponOomFieldNumber = 7; + private bool reportTensorAllocationsUponOom_; + /// + /// When enabled, causes tensor allocation information to be included in + /// the error message when the Run() call fails because the allocator ran + /// out of memory (OOM). + /// + /// Enabling this option can slow down the Run() call. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool ReportTensorAllocationsUponOom { + get { return reportTensorAllocationsUponOom_; } + set { + reportTensorAllocationsUponOom_ = value; + } + } + + /// Field number for the "experimental" field. + public const int ExperimentalFieldNumber = 8; + private global::Tensorflow.RunOptions.Types.Experimental experimental_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RunOptions.Types.Experimental Experimental { + get { return experimental_; } + set { + experimental_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RunOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RunOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TraceLevel != other.TraceLevel) return false; + if (TimeoutInMs != other.TimeoutInMs) return false; + if (InterOpThreadPool != other.InterOpThreadPool) return false; + if (OutputPartitionGraphs != other.OutputPartitionGraphs) return false; + if (!object.Equals(DebugOptions, other.DebugOptions)) return false; + if (ReportTensorAllocationsUponOom != other.ReportTensorAllocationsUponOom) return false; + if (!object.Equals(Experimental, other.Experimental)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TraceLevel != 0) hash ^= TraceLevel.GetHashCode(); + if (TimeoutInMs != 0L) hash ^= TimeoutInMs.GetHashCode(); + if (InterOpThreadPool != 0) hash ^= InterOpThreadPool.GetHashCode(); + if (OutputPartitionGraphs != false) hash ^= OutputPartitionGraphs.GetHashCode(); + if (debugOptions_ != null) hash ^= DebugOptions.GetHashCode(); + if (ReportTensorAllocationsUponOom != false) hash ^= ReportTensorAllocationsUponOom.GetHashCode(); + if (experimental_ != null) hash ^= Experimental.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (TraceLevel != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) TraceLevel); + } + if (TimeoutInMs != 0L) { + output.WriteRawTag(16); + output.WriteInt64(TimeoutInMs); + } + if (InterOpThreadPool != 0) { + output.WriteRawTag(24); + output.WriteInt32(InterOpThreadPool); + } + if (OutputPartitionGraphs != false) { + output.WriteRawTag(40); + output.WriteBool(OutputPartitionGraphs); + } + if (debugOptions_ != null) { + output.WriteRawTag(50); + output.WriteMessage(DebugOptions); + } + if (ReportTensorAllocationsUponOom != false) { + output.WriteRawTag(56); + output.WriteBool(ReportTensorAllocationsUponOom); + } + if (experimental_ != null) { + output.WriteRawTag(66); + output.WriteMessage(Experimental); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TraceLevel != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TraceLevel); + } + if (TimeoutInMs != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TimeoutInMs); + } + if (InterOpThreadPool != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InterOpThreadPool); + } + if (OutputPartitionGraphs != false) { + size += 1 + 1; + } + if (debugOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(DebugOptions); + } + if (ReportTensorAllocationsUponOom != false) { + size += 1 + 1; + } + if (experimental_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Experimental); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RunOptions other) { + if (other == null) { + return; + } + if (other.TraceLevel != 0) { + TraceLevel = other.TraceLevel; + } + if (other.TimeoutInMs != 0L) { + TimeoutInMs = other.TimeoutInMs; + } + if (other.InterOpThreadPool != 0) { + InterOpThreadPool = other.InterOpThreadPool; + } + if (other.OutputPartitionGraphs != false) { + OutputPartitionGraphs = other.OutputPartitionGraphs; + } + if (other.debugOptions_ != null) { + if (debugOptions_ == null) { + debugOptions_ = new global::Tensorflow.DebugOptions(); + } + DebugOptions.MergeFrom(other.DebugOptions); + } + if (other.ReportTensorAllocationsUponOom != false) { + ReportTensorAllocationsUponOom = other.ReportTensorAllocationsUponOom; + } + if (other.experimental_ != null) { + if (experimental_ == null) { + experimental_ = new global::Tensorflow.RunOptions.Types.Experimental(); + } + Experimental.MergeFrom(other.Experimental); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + traceLevel_ = (global::Tensorflow.RunOptions.Types.TraceLevel) input.ReadEnum(); + break; + } + case 16: { + TimeoutInMs = input.ReadInt64(); + break; + } + case 24: { + InterOpThreadPool = input.ReadInt32(); + break; + } + case 40: { + OutputPartitionGraphs = input.ReadBool(); + break; + } + case 50: { + if (debugOptions_ == null) { + debugOptions_ = new global::Tensorflow.DebugOptions(); + } + input.ReadMessage(debugOptions_); + break; + } + case 56: { + ReportTensorAllocationsUponOom = input.ReadBool(); + break; + } + case 66: { + if (experimental_ == null) { + experimental_ = new global::Tensorflow.RunOptions.Types.Experimental(); + } + input.ReadMessage(experimental_); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the RunOptions message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + /// + /// TODO(pbar) Turn this into a TraceOptions proto which allows + /// tracing to be controlled in a more orthogonal manner? + /// + public enum TraceLevel { + [pbr::OriginalName("NO_TRACE")] NoTrace = 0, + [pbr::OriginalName("SOFTWARE_TRACE")] SoftwareTrace = 1, + [pbr::OriginalName("HARDWARE_TRACE")] HardwareTrace = 2, + [pbr::OriginalName("FULL_TRACE")] FullTrace = 3, + } + + /// + /// Everything inside Experimental is subject to change and is not subject + /// to API stability guarantees in + /// https://www.tensorflow.org/guide/version_compat. + /// + public sealed partial class Experimental : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Experimental()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.RunOptions.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Experimental() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Experimental(Experimental other) : this() { + collectiveGraphKey_ = other.collectiveGraphKey_; + useRunHandlerPool_ = other.useRunHandlerPool_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Experimental Clone() { + return new Experimental(this); + } + + /// Field number for the "collective_graph_key" field. + public const int CollectiveGraphKeyFieldNumber = 1; + private long collectiveGraphKey_; + /// + /// If non-zero, declares that this graph is going to use collective + /// ops and must synchronize step_ids with any other graph with this + /// same group_key value (in a distributed computation where tasks + /// run disjoint graphs). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long CollectiveGraphKey { + get { return collectiveGraphKey_; } + set { + collectiveGraphKey_ = value; + } + } + + /// Field number for the "use_run_handler_pool" field. + public const int UseRunHandlerPoolFieldNumber = 2; + private bool useRunHandlerPool_; + /// + /// If true, then operations (using the inter-op pool) across all + /// session::run() calls will be centrally scheduled, optimizing for (median + /// and tail) latency. + /// Consider using this option for CPU-bound workloads like inference. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool UseRunHandlerPool { + get { return useRunHandlerPool_; } + set { + useRunHandlerPool_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Experimental); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Experimental other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CollectiveGraphKey != other.CollectiveGraphKey) return false; + if (UseRunHandlerPool != other.UseRunHandlerPool) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (CollectiveGraphKey != 0L) hash ^= CollectiveGraphKey.GetHashCode(); + if (UseRunHandlerPool != false) hash ^= UseRunHandlerPool.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (CollectiveGraphKey != 0L) { + output.WriteRawTag(8); + output.WriteInt64(CollectiveGraphKey); + } + if (UseRunHandlerPool != false) { + output.WriteRawTag(16); + output.WriteBool(UseRunHandlerPool); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (CollectiveGraphKey != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(CollectiveGraphKey); + } + if (UseRunHandlerPool != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Experimental other) { + if (other == null) { + return; + } + if (other.CollectiveGraphKey != 0L) { + CollectiveGraphKey = other.CollectiveGraphKey; + } + if (other.UseRunHandlerPool != false) { + UseRunHandlerPool = other.UseRunHandlerPool; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + CollectiveGraphKey = input.ReadInt64(); + break; + } + case 16: { + UseRunHandlerPool = input.ReadBool(); + break; + } + } + } + } + + } + + } + #endregion + + } + + /// + /// Metadata output (i.e., non-Tensor) for a single Run() call. + /// + public sealed partial class RunMetadata : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RunMetadata()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RunMetadata() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RunMetadata(RunMetadata other) : this() { + stepStats_ = other.stepStats_ != null ? other.stepStats_.Clone() : null; + costGraph_ = other.costGraph_ != null ? other.costGraph_.Clone() : null; + partitionGraphs_ = other.partitionGraphs_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RunMetadata Clone() { + return new RunMetadata(this); + } + + /// Field number for the "step_stats" field. + public const int StepStatsFieldNumber = 1; + private global::Tensorflow.StepStats stepStats_; + /// + /// Statistics traced for this step. Populated if tracing is turned on via the + /// "RunOptions" proto. + /// EXPERIMENTAL: The format and set of events may change in future versions. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.StepStats StepStats { + get { return stepStats_; } + set { + stepStats_ = value; + } + } + + /// Field number for the "cost_graph" field. + public const int CostGraphFieldNumber = 2; + private global::Tensorflow.CostGraphDef costGraph_; + /// + /// The cost graph for the computation defined by the run call. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.CostGraphDef CostGraph { + get { return costGraph_; } + set { + costGraph_ = value; + } + } + + /// Field number for the "partition_graphs" field. + public const int PartitionGraphsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_partitionGraphs_codec + = pb::FieldCodec.ForMessage(26, global::Tensorflow.GraphDef.Parser); + private readonly pbc::RepeatedField partitionGraphs_ = new pbc::RepeatedField(); + /// + /// Graphs of the partitions executed by executors. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField PartitionGraphs { + get { return partitionGraphs_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RunMetadata); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RunMetadata other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(StepStats, other.StepStats)) return false; + if (!object.Equals(CostGraph, other.CostGraph)) return false; + if(!partitionGraphs_.Equals(other.partitionGraphs_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (stepStats_ != null) hash ^= StepStats.GetHashCode(); + if (costGraph_ != null) hash ^= CostGraph.GetHashCode(); + hash ^= partitionGraphs_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (stepStats_ != null) { + output.WriteRawTag(10); + output.WriteMessage(StepStats); + } + if (costGraph_ != null) { + output.WriteRawTag(18); + output.WriteMessage(CostGraph); + } + partitionGraphs_.WriteTo(output, _repeated_partitionGraphs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (stepStats_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StepStats); + } + if (costGraph_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(CostGraph); + } + size += partitionGraphs_.CalculateSize(_repeated_partitionGraphs_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RunMetadata other) { + if (other == null) { + return; + } + if (other.stepStats_ != null) { + if (stepStats_ == null) { + stepStats_ = new global::Tensorflow.StepStats(); + } + StepStats.MergeFrom(other.StepStats); + } + if (other.costGraph_ != null) { + if (costGraph_ == null) { + costGraph_ = new global::Tensorflow.CostGraphDef(); + } + CostGraph.MergeFrom(other.CostGraph); + } + partitionGraphs_.Add(other.partitionGraphs_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (stepStats_ == null) { + stepStats_ = new global::Tensorflow.StepStats(); + } + input.ReadMessage(stepStats_); + break; + } + case 18: { + if (costGraph_ == null) { + costGraph_ = new global::Tensorflow.CostGraphDef(); + } + input.ReadMessage(costGraph_); + break; + } + case 26: { + partitionGraphs_.AddEntriesFrom(input, _repeated_partitionGraphs_codec); + break; + } + } + } + } + + } + + /// + /// Defines a connection between two tensors in a `GraphDef`. + /// + public sealed partial class TensorConnection : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorConnection()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TensorConnection() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TensorConnection(TensorConnection other) : this() { + fromTensor_ = other.fromTensor_; + toTensor_ = other.toTensor_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TensorConnection Clone() { + return new TensorConnection(this); + } + + /// Field number for the "from_tensor" field. + public const int FromTensorFieldNumber = 1; + private string fromTensor_ = ""; + /// + /// A tensor name. The value of this tensor will be substituted for + /// the tensor named in `to_tensor`. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string FromTensor { + get { return fromTensor_; } + set { + fromTensor_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "to_tensor" field. + public const int ToTensorFieldNumber = 2; + private string toTensor_ = ""; + /// + /// A tensor name. The value of this tensor will be bound to the + /// value of the tensor named in `from_tensor`. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ToTensor { + get { return toTensor_; } + set { + toTensor_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TensorConnection); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TensorConnection other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FromTensor != other.FromTensor) return false; + if (ToTensor != other.ToTensor) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (FromTensor.Length != 0) hash ^= FromTensor.GetHashCode(); + if (ToTensor.Length != 0) hash ^= ToTensor.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (FromTensor.Length != 0) { + output.WriteRawTag(10); + output.WriteString(FromTensor); + } + if (ToTensor.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ToTensor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (FromTensor.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FromTensor); + } + if (ToTensor.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ToTensor); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TensorConnection other) { + if (other == null) { + return; + } + if (other.FromTensor.Length != 0) { + FromTensor = other.FromTensor; + } + if (other.ToTensor.Length != 0) { + ToTensor = other.ToTensor; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + FromTensor = input.ReadString(); + break; + } + case 18: { + ToTensor = input.ReadString(); + break; + } + } + } + } + + } + + /// + /// Defines a subgraph in another `GraphDef` as a set of feed points and nodes + /// to be fetched or executed. + /// + /// Compare with the arguments to `Session::Run()`. + /// + public sealed partial class CallableOptions : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CallableOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ConfigReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CallableOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CallableOptions(CallableOptions other) : this() { + feed_ = other.feed_.Clone(); + fetch_ = other.fetch_.Clone(); + target_ = other.target_.Clone(); + runOptions_ = other.runOptions_ != null ? other.runOptions_.Clone() : null; + tensorConnection_ = other.tensorConnection_.Clone(); + feedDevices_ = other.feedDevices_.Clone(); + fetchDevices_ = other.fetchDevices_.Clone(); + fetchSkipSync_ = other.fetchSkipSync_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CallableOptions Clone() { + return new CallableOptions(this); + } + + /// Field number for the "feed" field. + public const int FeedFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_feed_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField feed_ = new pbc::RepeatedField(); + /// + /// Tensors to be fed in the callable. Each feed is the name of a tensor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Feed { + get { return feed_; } + } + + /// Field number for the "fetch" field. + public const int FetchFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_fetch_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField fetch_ = new pbc::RepeatedField(); + /// + /// Fetches. A list of tensor names. The caller of the callable expects a + /// tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The + /// order of specified fetches does not change the execution order. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Fetch { + get { return fetch_; } + } + + /// Field number for the "target" field. + public const int TargetFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_target_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField target_ = new pbc::RepeatedField(); + /// + /// Target Nodes. A list of node names. The named nodes will be run by the + /// callable but their outputs will not be returned. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Target { + get { return target_; } + } + + /// Field number for the "run_options" field. + public const int RunOptionsFieldNumber = 4; + private global::Tensorflow.RunOptions runOptions_; + /// + /// Options that will be applied to each run. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RunOptions RunOptions { + get { return runOptions_; } + set { + runOptions_ = value; + } + } + + /// Field number for the "tensor_connection" field. + public const int TensorConnectionFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_tensorConnection_codec + = pb::FieldCodec.ForMessage(42, global::Tensorflow.TensorConnection.Parser); + private readonly pbc::RepeatedField tensorConnection_ = new pbc::RepeatedField(); + /// + /// Tensors to be connected in the callable. Each TensorConnection denotes + /// a pair of tensors in the graph, between which an edge will be created + /// in the callable. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField TensorConnection { + get { return tensorConnection_; } + } + + /// Field number for the "feed_devices" field. + public const int FeedDevicesFieldNumber = 6; + private static readonly pbc::MapField.Codec _map_feedDevices_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 50); + private readonly pbc::MapField feedDevices_ = new pbc::MapField(); + /// + /// The Tensor objects fed in the callable and fetched from the callable + /// are expected to be backed by host (CPU) memory by default. + /// + /// The options below allow changing that - feeding tensors backed by + /// device memory, or returning tensors that are backed by device memory. + /// + /// The maps below map the name of a feed/fetch tensor (which appears in + /// 'feed' or 'fetch' fields above), to the fully qualified name of the device + /// owning the memory backing the contents of the tensor. + /// + /// For example, creating a callable with the following options: + /// + /// CallableOptions { + /// feed: "a:0" + /// feed: "b:0" + /// + /// fetch: "x:0" + /// fetch: "y:0" + /// + /// feed_devices: { + /// "a:0": "/job:localhost/replica:0/task:0/device:GPU:0" + /// } + /// + /// fetch_devices: { + /// "y:0": "/job:localhost/replica:0/task:0/device:GPU:0" + /// } + /// } + /// + /// means that the Callable expects: + /// - The first argument ("a:0") is a Tensor backed by GPU memory. + /// - The second argument ("b:0") is a Tensor backed by host memory. + /// and of its return values: + /// - The first output ("x:0") will be backed by host memory. + /// - The second output ("y:0") will be backed by GPU memory. + /// + /// FEEDS: + /// It is the responsibility of the caller to ensure that the memory of the fed + /// tensors will be correctly initialized and synchronized before it is + /// accessed by operations executed during the call to Session::RunCallable(). + /// + /// This is typically ensured by using the TensorFlow memory allocators + /// (Device::GetAllocator()) to create the Tensor to be fed. + /// + /// Alternatively, for CUDA-enabled GPU devices, this typically means that the + /// operation that produced the contents of the tensor has completed, i.e., the + /// CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or + /// cuStreamSynchronize()). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField FeedDevices { + get { return feedDevices_; } + } + + /// Field number for the "fetch_devices" field. + public const int FetchDevicesFieldNumber = 7; + private static readonly pbc::MapField.Codec _map_fetchDevices_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 58); + private readonly pbc::MapField fetchDevices_ = new pbc::MapField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField FetchDevices { + get { return fetchDevices_; } + } + + /// Field number for the "fetch_skip_sync" field. + public const int FetchSkipSyncFieldNumber = 8; + private bool fetchSkipSync_; + /// + /// By default, RunCallable() will synchronize the GPU stream before returning + /// fetched tensors on a GPU device, to ensure that the values in those tensors + /// have been produced. This simplifies interacting with the tensors, but + /// potentially incurs a performance hit. + /// + /// If this options is set to true, the caller is responsible for ensuring + /// that the values in the fetched tensors have been produced before they are + /// used. The caller can do this by invoking `Device::Sync()` on the underlying + /// device(s), or by feeding the tensors back to the same Session using + /// `feed_devices` with the same corresponding device name. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool FetchSkipSync { + get { return fetchSkipSync_; } + set { + fetchSkipSync_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CallableOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CallableOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!feed_.Equals(other.feed_)) return false; + if(!fetch_.Equals(other.fetch_)) return false; + if(!target_.Equals(other.target_)) return false; + if (!object.Equals(RunOptions, other.RunOptions)) return false; + if(!tensorConnection_.Equals(other.tensorConnection_)) return false; + if (!FeedDevices.Equals(other.FeedDevices)) return false; + if (!FetchDevices.Equals(other.FetchDevices)) return false; + if (FetchSkipSync != other.FetchSkipSync) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= feed_.GetHashCode(); + hash ^= fetch_.GetHashCode(); + hash ^= target_.GetHashCode(); + if (runOptions_ != null) hash ^= RunOptions.GetHashCode(); + hash ^= tensorConnection_.GetHashCode(); + hash ^= FeedDevices.GetHashCode(); + hash ^= FetchDevices.GetHashCode(); + if (FetchSkipSync != false) hash ^= FetchSkipSync.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + feed_.WriteTo(output, _repeated_feed_codec); + fetch_.WriteTo(output, _repeated_fetch_codec); + target_.WriteTo(output, _repeated_target_codec); + if (runOptions_ != null) { + output.WriteRawTag(34); + output.WriteMessage(RunOptions); + } + tensorConnection_.WriteTo(output, _repeated_tensorConnection_codec); + feedDevices_.WriteTo(output, _map_feedDevices_codec); + fetchDevices_.WriteTo(output, _map_fetchDevices_codec); + if (FetchSkipSync != false) { + output.WriteRawTag(64); + output.WriteBool(FetchSkipSync); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += feed_.CalculateSize(_repeated_feed_codec); + size += fetch_.CalculateSize(_repeated_fetch_codec); + size += target_.CalculateSize(_repeated_target_codec); + if (runOptions_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RunOptions); + } + size += tensorConnection_.CalculateSize(_repeated_tensorConnection_codec); + size += feedDevices_.CalculateSize(_map_feedDevices_codec); + size += fetchDevices_.CalculateSize(_map_fetchDevices_codec); + if (FetchSkipSync != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CallableOptions other) { + if (other == null) { + return; + } + feed_.Add(other.feed_); + fetch_.Add(other.fetch_); + target_.Add(other.target_); + if (other.runOptions_ != null) { + if (runOptions_ == null) { + runOptions_ = new global::Tensorflow.RunOptions(); + } + RunOptions.MergeFrom(other.RunOptions); + } + tensorConnection_.Add(other.tensorConnection_); + feedDevices_.Add(other.feedDevices_); + fetchDevices_.Add(other.fetchDevices_); + if (other.FetchSkipSync != false) { + FetchSkipSync = other.FetchSkipSync; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + feed_.AddEntriesFrom(input, _repeated_feed_codec); + break; + } + case 18: { + fetch_.AddEntriesFrom(input, _repeated_fetch_codec); + break; + } + case 26: { + target_.AddEntriesFrom(input, _repeated_target_codec); + break; + } + case 34: { + if (runOptions_ == null) { + runOptions_ = new global::Tensorflow.RunOptions(); + } + input.ReadMessage(runOptions_); + break; + } + case 42: { + tensorConnection_.AddEntriesFrom(input, _repeated_tensorConnection_codec); + break; + } + case 50: { + feedDevices_.AddEntriesFrom(input, _map_feedDevices_codec); + break; + } + case 58: { + fetchDevices_.AddEntriesFrom(input, _map_fetchDevices_codec); + break; + } + case 64: { + FetchSkipSync = input.ReadBool(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/CostGraph.cs b/src/TensorFlowNET.Core/Protobuf/CostGraph.cs new file mode 100644 index 00000000..0d7f0ba7 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/CostGraph.cs @@ -0,0 +1,1155 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/cost_graph.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/cost_graph.proto + public static partial class CostGraphReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/cost_graph.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static CostGraphReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2Nvc3RfZ3JhcGgucHJvdG8S", + "CnRlbnNvcmZsb3caLHRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvdGVuc29y", + "X3NoYXBlLnByb3RvGiV0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3R5cGVz", + "LnByb3RvIuAFCgxDb3N0R3JhcGhEZWYSKwoEbm9kZRgBIAMoCzIdLnRlbnNv", + "cmZsb3cuQ29zdEdyYXBoRGVmLk5vZGUaogUKBE5vZGUSDAoEbmFtZRgBIAEo", + "CRIOCgZkZXZpY2UYAiABKAkSCgoCaWQYAyABKAUSOwoKaW5wdXRfaW5mbxgE", + "IAMoCzInLnRlbnNvcmZsb3cuQ29zdEdyYXBoRGVmLk5vZGUuSW5wdXRJbmZv", + "Ej0KC291dHB1dF9pbmZvGAUgAygLMigudGVuc29yZmxvdy5Db3N0R3JhcGhE", + "ZWYuTm9kZS5PdXRwdXRJbmZvEh0KFXRlbXBvcmFyeV9tZW1vcnlfc2l6ZRgG", + "IAEoAxIeChZwZXJzaXN0ZW50X21lbW9yeV9zaXplGAwgASgDEiEKFWhvc3Rf", + "dGVtcF9tZW1vcnlfc2l6ZRgKIAEoA0ICGAESIwoXZGV2aWNlX3RlbXBfbWVt", + "b3J5X3NpemUYCyABKANCAhgBEikKHWRldmljZV9wZXJzaXN0ZW50X21lbW9y", + "eV9zaXplGBAgASgDQgIYARIUCgxjb21wdXRlX2Nvc3QYCSABKAMSFAoMY29t", + "cHV0ZV90aW1lGA4gASgDEhMKC21lbW9yeV90aW1lGA8gASgDEhAKCGlzX2Zp", + "bmFsGAcgASgIEhUKDWNvbnRyb2xfaW5wdXQYCCADKAUSEgoKaW5hY2N1cmF0", + "ZRgRIAEoCBo7CglJbnB1dEluZm8SFgoOcHJlY2VkaW5nX25vZGUYASABKAUS", + "FgoOcHJlY2VkaW5nX3BvcnQYAiABKAUahgEKCk91dHB1dEluZm8SDAoEc2l6", + "ZRgBIAEoAxIYChBhbGlhc19pbnB1dF9wb3J0GAIgASgDEisKBXNoYXBlGAMg", + "ASgLMhwudGVuc29yZmxvdy5UZW5zb3JTaGFwZVByb3RvEiMKBWR0eXBlGAQg", + "ASgOMhQudGVuc29yZmxvdy5EYXRhVHlwZUJvChhvcmcudGVuc29yZmxvdy5m", + "cmFtZXdvcmtCD0Nvc3RHcmFwaFByb3Rvc1ABWj1naXRodWIuY29tL3RlbnNv", + "cmZsb3cvdGVuc29yZmxvdy90ZW5zb3JmbG93L2dvL2NvcmUvZnJhbWV3b3Jr", + "+AEBYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tensorflow.TensorShapeReflection.Descriptor, global::Tensorflow.TypesReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + 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), + 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)})}) + })); + } + #endregion + + } + #region Messages + public sealed partial class CostGraphDef : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CostGraphDef()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.CostGraphReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CostGraphDef() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CostGraphDef(CostGraphDef other) : this() { + node_ = other.node_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CostGraphDef Clone() { + return new CostGraphDef(this); + } + + /// Field number for the "node" field. + public const int NodeFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_node_codec + = pb::FieldCodec.ForMessage(10, global::Tensorflow.CostGraphDef.Types.Node.Parser); + private readonly pbc::RepeatedField node_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Node { + get { return node_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CostGraphDef); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CostGraphDef other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!node_.Equals(other.node_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= node_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + node_.WriteTo(output, _repeated_node_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += node_.CalculateSize(_repeated_node_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CostGraphDef other) { + if (other == null) { + return; + } + node_.Add(other.node_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + node_.AddEntriesFrom(input, _repeated_node_codec); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the CostGraphDef message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + public sealed partial class Node : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Node()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.CostGraphDef.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Node() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Node(Node other) : this() { + name_ = other.name_; + device_ = other.device_; + id_ = other.id_; + inputInfo_ = other.inputInfo_.Clone(); + outputInfo_ = other.outputInfo_.Clone(); + temporaryMemorySize_ = other.temporaryMemorySize_; + persistentMemorySize_ = other.persistentMemorySize_; + hostTempMemorySize_ = other.hostTempMemorySize_; + deviceTempMemorySize_ = other.deviceTempMemorySize_; + devicePersistentMemorySize_ = other.devicePersistentMemorySize_; + computeCost_ = other.computeCost_; + computeTime_ = other.computeTime_; + memoryTime_ = other.memoryTime_; + isFinal_ = other.isFinal_; + controlInput_ = other.controlInput_.Clone(); + inaccurate_ = other.inaccurate_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Node Clone() { + return new Node(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// The name of the node. Names are globally unique. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "device" field. + public const int DeviceFieldNumber = 2; + private string device_ = ""; + /// + /// The device of the node. Can be empty if the node is mapped to the + /// default partition or partitioning hasn't been run yet. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Device { + get { return device_; } + set { + device_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "id" field. + public const int IdFieldNumber = 3; + private int id_; + /// + /// The id of the node. Node ids are only unique inside a partition. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Id { + get { return id_; } + set { + id_ = value; + } + } + + /// Field number for the "input_info" field. + public const int InputInfoFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_inputInfo_codec + = pb::FieldCodec.ForMessage(34, global::Tensorflow.CostGraphDef.Types.Node.Types.InputInfo.Parser); + private readonly pbc::RepeatedField inputInfo_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField InputInfo { + get { return inputInfo_; } + } + + /// Field number for the "output_info" field. + public const int OutputInfoFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_outputInfo_codec + = pb::FieldCodec.ForMessage(42, global::Tensorflow.CostGraphDef.Types.Node.Types.OutputInfo.Parser); + private readonly pbc::RepeatedField outputInfo_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField OutputInfo { + get { return outputInfo_; } + } + + /// Field number for the "temporary_memory_size" field. + public const int TemporaryMemorySizeFieldNumber = 6; + private long temporaryMemorySize_; + /// + /// Temporary memory used by this node. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long TemporaryMemorySize { + get { return temporaryMemorySize_; } + set { + temporaryMemorySize_ = value; + } + } + + /// Field number for the "persistent_memory_size" field. + public const int PersistentMemorySizeFieldNumber = 12; + private long persistentMemorySize_; + /// + /// Persistent memory used by this node. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long PersistentMemorySize { + get { return persistentMemorySize_; } + set { + persistentMemorySize_ = value; + } + } + + /// Field number for the "host_temp_memory_size" field. + public const int HostTempMemorySizeFieldNumber = 10; + private long hostTempMemorySize_; + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long HostTempMemorySize { + get { return hostTempMemorySize_; } + set { + hostTempMemorySize_ = value; + } + } + + /// Field number for the "device_temp_memory_size" field. + public const int DeviceTempMemorySizeFieldNumber = 11; + private long deviceTempMemorySize_; + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long DeviceTempMemorySize { + get { return deviceTempMemorySize_; } + set { + deviceTempMemorySize_ = value; + } + } + + /// Field number for the "device_persistent_memory_size" field. + public const int DevicePersistentMemorySizeFieldNumber = 16; + private long devicePersistentMemorySize_; + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long DevicePersistentMemorySize { + get { return devicePersistentMemorySize_; } + set { + devicePersistentMemorySize_ = value; + } + } + + /// Field number for the "compute_cost" field. + public const int ComputeCostFieldNumber = 9; + private long computeCost_; + /// + /// Estimate of the computational cost of this node, in microseconds. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long ComputeCost { + get { return computeCost_; } + set { + computeCost_ = value; + } + } + + /// Field number for the "compute_time" field. + public const int ComputeTimeFieldNumber = 14; + private long computeTime_; + /// + /// Analytical estimate of the computational cost of this node, in + /// microseconds. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long ComputeTime { + get { return computeTime_; } + set { + computeTime_ = value; + } + } + + /// Field number for the "memory_time" field. + public const int MemoryTimeFieldNumber = 15; + private long memoryTime_; + /// + /// Analytical estimate of the memory access cost of this node, in + /// microseconds. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long MemoryTime { + get { return memoryTime_; } + set { + memoryTime_ = value; + } + } + + /// Field number for the "is_final" field. + public const int IsFinalFieldNumber = 7; + private bool isFinal_; + /// + /// If true, the output is permanent: it can't be discarded, because this + /// node is part of the "final output". Nodes may depend on final nodes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool IsFinal { + get { return isFinal_; } + set { + isFinal_ = value; + } + } + + /// Field number for the "control_input" field. + public const int ControlInputFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_controlInput_codec + = pb::FieldCodec.ForInt32(66); + private readonly pbc::RepeatedField controlInput_ = new pbc::RepeatedField(); + /// + /// Ids of the control inputs for this node. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ControlInput { + get { return controlInput_; } + } + + /// Field number for the "inaccurate" field. + public const int InaccurateFieldNumber = 17; + private bool inaccurate_; + /// + /// Are the costs inaccurate? + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Inaccurate { + get { return inaccurate_; } + set { + inaccurate_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Node); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Node other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (Device != other.Device) return false; + if (Id != other.Id) return false; + if(!inputInfo_.Equals(other.inputInfo_)) return false; + if(!outputInfo_.Equals(other.outputInfo_)) return false; + if (TemporaryMemorySize != other.TemporaryMemorySize) return false; + if (PersistentMemorySize != other.PersistentMemorySize) return false; + if (HostTempMemorySize != other.HostTempMemorySize) return false; + if (DeviceTempMemorySize != other.DeviceTempMemorySize) return false; + if (DevicePersistentMemorySize != other.DevicePersistentMemorySize) return false; + if (ComputeCost != other.ComputeCost) return false; + if (ComputeTime != other.ComputeTime) return false; + if (MemoryTime != other.MemoryTime) return false; + if (IsFinal != other.IsFinal) return false; + if(!controlInput_.Equals(other.controlInput_)) return false; + if (Inaccurate != other.Inaccurate) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (Device.Length != 0) hash ^= Device.GetHashCode(); + if (Id != 0) hash ^= Id.GetHashCode(); + hash ^= inputInfo_.GetHashCode(); + hash ^= outputInfo_.GetHashCode(); + if (TemporaryMemorySize != 0L) hash ^= TemporaryMemorySize.GetHashCode(); + if (PersistentMemorySize != 0L) hash ^= PersistentMemorySize.GetHashCode(); + if (HostTempMemorySize != 0L) hash ^= HostTempMemorySize.GetHashCode(); + if (DeviceTempMemorySize != 0L) hash ^= DeviceTempMemorySize.GetHashCode(); + if (DevicePersistentMemorySize != 0L) hash ^= DevicePersistentMemorySize.GetHashCode(); + if (ComputeCost != 0L) hash ^= ComputeCost.GetHashCode(); + if (ComputeTime != 0L) hash ^= ComputeTime.GetHashCode(); + if (MemoryTime != 0L) hash ^= MemoryTime.GetHashCode(); + if (IsFinal != false) hash ^= IsFinal.GetHashCode(); + hash ^= controlInput_.GetHashCode(); + if (Inaccurate != false) hash ^= Inaccurate.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Device.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Device); + } + if (Id != 0) { + output.WriteRawTag(24); + output.WriteInt32(Id); + } + inputInfo_.WriteTo(output, _repeated_inputInfo_codec); + outputInfo_.WriteTo(output, _repeated_outputInfo_codec); + if (TemporaryMemorySize != 0L) { + output.WriteRawTag(48); + output.WriteInt64(TemporaryMemorySize); + } + if (IsFinal != false) { + output.WriteRawTag(56); + output.WriteBool(IsFinal); + } + controlInput_.WriteTo(output, _repeated_controlInput_codec); + if (ComputeCost != 0L) { + output.WriteRawTag(72); + output.WriteInt64(ComputeCost); + } + if (HostTempMemorySize != 0L) { + output.WriteRawTag(80); + output.WriteInt64(HostTempMemorySize); + } + if (DeviceTempMemorySize != 0L) { + output.WriteRawTag(88); + output.WriteInt64(DeviceTempMemorySize); + } + if (PersistentMemorySize != 0L) { + output.WriteRawTag(96); + output.WriteInt64(PersistentMemorySize); + } + if (ComputeTime != 0L) { + output.WriteRawTag(112); + output.WriteInt64(ComputeTime); + } + if (MemoryTime != 0L) { + output.WriteRawTag(120); + output.WriteInt64(MemoryTime); + } + if (DevicePersistentMemorySize != 0L) { + output.WriteRawTag(128, 1); + output.WriteInt64(DevicePersistentMemorySize); + } + if (Inaccurate != false) { + output.WriteRawTag(136, 1); + output.WriteBool(Inaccurate); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (Device.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Device); + } + if (Id != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); + } + size += inputInfo_.CalculateSize(_repeated_inputInfo_codec); + size += outputInfo_.CalculateSize(_repeated_outputInfo_codec); + if (TemporaryMemorySize != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TemporaryMemorySize); + } + if (PersistentMemorySize != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PersistentMemorySize); + } + if (HostTempMemorySize != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(HostTempMemorySize); + } + if (DeviceTempMemorySize != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(DeviceTempMemorySize); + } + if (DevicePersistentMemorySize != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(DevicePersistentMemorySize); + } + if (ComputeCost != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ComputeCost); + } + if (ComputeTime != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ComputeTime); + } + if (MemoryTime != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(MemoryTime); + } + if (IsFinal != false) { + size += 1 + 1; + } + size += controlInput_.CalculateSize(_repeated_controlInput_codec); + if (Inaccurate != false) { + size += 2 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Node other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.Device.Length != 0) { + Device = other.Device; + } + if (other.Id != 0) { + Id = other.Id; + } + inputInfo_.Add(other.inputInfo_); + outputInfo_.Add(other.outputInfo_); + if (other.TemporaryMemorySize != 0L) { + TemporaryMemorySize = other.TemporaryMemorySize; + } + if (other.PersistentMemorySize != 0L) { + PersistentMemorySize = other.PersistentMemorySize; + } + if (other.HostTempMemorySize != 0L) { + HostTempMemorySize = other.HostTempMemorySize; + } + if (other.DeviceTempMemorySize != 0L) { + DeviceTempMemorySize = other.DeviceTempMemorySize; + } + if (other.DevicePersistentMemorySize != 0L) { + DevicePersistentMemorySize = other.DevicePersistentMemorySize; + } + if (other.ComputeCost != 0L) { + ComputeCost = other.ComputeCost; + } + if (other.ComputeTime != 0L) { + ComputeTime = other.ComputeTime; + } + if (other.MemoryTime != 0L) { + MemoryTime = other.MemoryTime; + } + if (other.IsFinal != false) { + IsFinal = other.IsFinal; + } + controlInput_.Add(other.controlInput_); + if (other.Inaccurate != false) { + Inaccurate = other.Inaccurate; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Device = input.ReadString(); + break; + } + case 24: { + Id = input.ReadInt32(); + break; + } + case 34: { + inputInfo_.AddEntriesFrom(input, _repeated_inputInfo_codec); + break; + } + case 42: { + outputInfo_.AddEntriesFrom(input, _repeated_outputInfo_codec); + break; + } + case 48: { + TemporaryMemorySize = input.ReadInt64(); + break; + } + case 56: { + IsFinal = input.ReadBool(); + break; + } + case 66: + case 64: { + controlInput_.AddEntriesFrom(input, _repeated_controlInput_codec); + break; + } + case 72: { + ComputeCost = input.ReadInt64(); + break; + } + case 80: { + HostTempMemorySize = input.ReadInt64(); + break; + } + case 88: { + DeviceTempMemorySize = input.ReadInt64(); + break; + } + case 96: { + PersistentMemorySize = input.ReadInt64(); + break; + } + case 112: { + ComputeTime = input.ReadInt64(); + break; + } + case 120: { + MemoryTime = input.ReadInt64(); + break; + } + case 128: { + DevicePersistentMemorySize = input.ReadInt64(); + break; + } + case 136: { + Inaccurate = input.ReadBool(); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the Node message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + /// + /// Inputs of this node. They must be executed before this node can be + /// executed. An input is a particular output of another node, specified + /// by the node id and the output index. + /// + public sealed partial class InputInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InputInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.CostGraphDef.Types.Node.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InputInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InputInfo(InputInfo other) : this() { + precedingNode_ = other.precedingNode_; + precedingPort_ = other.precedingPort_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InputInfo Clone() { + return new InputInfo(this); + } + + /// Field number for the "preceding_node" field. + public const int PrecedingNodeFieldNumber = 1; + private int precedingNode_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PrecedingNode { + get { return precedingNode_; } + set { + precedingNode_ = value; + } + } + + /// Field number for the "preceding_port" field. + public const int PrecedingPortFieldNumber = 2; + private int precedingPort_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PrecedingPort { + get { return precedingPort_; } + set { + precedingPort_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as InputInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(InputInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (PrecedingNode != other.PrecedingNode) return false; + if (PrecedingPort != other.PrecedingPort) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (PrecedingNode != 0) hash ^= PrecedingNode.GetHashCode(); + if (PrecedingPort != 0) hash ^= PrecedingPort.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (PrecedingNode != 0) { + output.WriteRawTag(8); + output.WriteInt32(PrecedingNode); + } + if (PrecedingPort != 0) { + output.WriteRawTag(16); + output.WriteInt32(PrecedingPort); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (PrecedingNode != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrecedingNode); + } + if (PrecedingPort != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrecedingPort); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(InputInfo other) { + if (other == null) { + return; + } + if (other.PrecedingNode != 0) { + PrecedingNode = other.PrecedingNode; + } + if (other.PrecedingPort != 0) { + PrecedingPort = other.PrecedingPort; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + PrecedingNode = input.ReadInt32(); + break; + } + case 16: { + PrecedingPort = input.ReadInt32(); + break; + } + } + } + } + + } + + /// + /// Outputs of this node. + /// + public sealed partial class OutputInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OutputInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.CostGraphDef.Types.Node.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OutputInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OutputInfo(OutputInfo other) : this() { + size_ = other.size_; + aliasInputPort_ = other.aliasInputPort_; + shape_ = other.shape_ != null ? other.shape_.Clone() : null; + dtype_ = other.dtype_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public OutputInfo Clone() { + return new OutputInfo(this); + } + + /// Field number for the "size" field. + public const int SizeFieldNumber = 1; + private long size_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Size { + get { return size_; } + set { + size_ = value; + } + } + + /// Field number for the "alias_input_port" field. + public const int AliasInputPortFieldNumber = 2; + private long aliasInputPort_; + /// + /// If >= 0, the output is an alias of an input. Note that an alias input + /// may itself be an alias. The algorithm will therefore need to follow + /// those pointers. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AliasInputPort { + get { return aliasInputPort_; } + set { + aliasInputPort_ = value; + } + } + + /// Field number for the "shape" field. + public const int ShapeFieldNumber = 3; + private global::Tensorflow.TensorShapeProto shape_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.TensorShapeProto Shape { + get { return shape_; } + set { + shape_ = value; + } + } + + /// Field number for the "dtype" field. + public const int DtypeFieldNumber = 4; + private global::Tensorflow.DataType dtype_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.DataType Dtype { + get { return dtype_; } + set { + dtype_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as OutputInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(OutputInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Size != other.Size) return false; + if (AliasInputPort != other.AliasInputPort) return false; + if (!object.Equals(Shape, other.Shape)) return false; + if (Dtype != other.Dtype) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Size != 0L) hash ^= Size.GetHashCode(); + if (AliasInputPort != 0L) hash ^= AliasInputPort.GetHashCode(); + if (shape_ != null) hash ^= Shape.GetHashCode(); + if (Dtype != 0) hash ^= Dtype.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Size != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Size); + } + if (AliasInputPort != 0L) { + output.WriteRawTag(16); + output.WriteInt64(AliasInputPort); + } + if (shape_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Shape); + } + if (Dtype != 0) { + output.WriteRawTag(32); + output.WriteEnum((int) Dtype); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Size != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Size); + } + if (AliasInputPort != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AliasInputPort); + } + if (shape_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Shape); + } + if (Dtype != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Dtype); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(OutputInfo other) { + if (other == null) { + return; + } + if (other.Size != 0L) { + Size = other.Size; + } + if (other.AliasInputPort != 0L) { + AliasInputPort = other.AliasInputPort; + } + if (other.shape_ != null) { + if (shape_ == null) { + shape_ = new global::Tensorflow.TensorShapeProto(); + } + Shape.MergeFrom(other.Shape); + } + if (other.Dtype != 0) { + Dtype = other.Dtype; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Size = input.ReadInt64(); + break; + } + case 16: { + AliasInputPort = input.ReadInt64(); + break; + } + case 26: { + if (shape_ == null) { + shape_ = new global::Tensorflow.TensorShapeProto(); + } + input.ReadMessage(shape_); + break; + } + case 32: { + dtype_ = (global::Tensorflow.DataType) input.ReadEnum(); + break; + } + } + } + } + + } + + } + #endregion + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/Debug.cs b/src/TensorFlowNET.Core/Protobuf/Debug.cs new file mode 100644 index 00000000..5e39a0b8 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/Debug.cs @@ -0,0 +1,893 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/protobuf/debug.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/protobuf/debug.proto + public static partial class DebugReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/protobuf/debug.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DebugReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CiR0ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvZGVidWcucHJvdG8SCnRlbnNv", + "cmZsb3cijgEKEERlYnVnVGVuc29yV2F0Y2gSEQoJbm9kZV9uYW1lGAEgASgJ", + "EhMKC291dHB1dF9zbG90GAIgASgFEhEKCWRlYnVnX29wcxgDIAMoCRISCgpk", + "ZWJ1Z191cmxzGAQgAygJEisKI3RvbGVyYXRlX2RlYnVnX29wX2NyZWF0aW9u", + "X2ZhaWx1cmVzGAUgASgIIoEBCgxEZWJ1Z09wdGlvbnMSPQoXZGVidWdfdGVu", + "c29yX3dhdGNoX29wdHMYBCADKAsyHC50ZW5zb3JmbG93LkRlYnVnVGVuc29y", + "V2F0Y2gSEwoLZ2xvYmFsX3N0ZXAYCiABKAMSHQoVcmVzZXRfZGlza19ieXRl", + "X3VzYWdlGAsgASgIImoKEkRlYnVnZ2VkU291cmNlRmlsZRIMCgRob3N0GAEg", + "ASgJEhEKCWZpbGVfcGF0aBgCIAEoCRIVCg1sYXN0X21vZGlmaWVkGAMgASgD", + "Eg0KBWJ5dGVzGAQgASgDEg0KBWxpbmVzGAUgAygJIksKE0RlYnVnZ2VkU291", + "cmNlRmlsZXMSNAoMc291cmNlX2ZpbGVzGAEgAygLMh4udGVuc29yZmxvdy5E", + "ZWJ1Z2dlZFNvdXJjZUZpbGVCagoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3Jr", + "QgtEZWJ1Z1Byb3Rvc1ABWjxnaXRodWIuY29tL3RlbnNvcmZsb3cvdGVuc29y", + "Zmxvdy90ZW5zb3JmbG93L2dvL2NvcmUvcHJvdG9idWb4AQFiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DebugTensorWatch), global::Tensorflow.DebugTensorWatch.Parser, new[]{ "NodeName", "OutputSlot", "DebugOps", "DebugUrls", "TolerateDebugOpCreationFailures" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DebugOptions), global::Tensorflow.DebugOptions.Parser, new[]{ "DebugTensorWatchOpts", "GlobalStep", "ResetDiskByteUsage" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DebuggedSourceFile), global::Tensorflow.DebuggedSourceFile.Parser, new[]{ "Host", "FilePath", "LastModified", "Bytes", "Lines" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DebuggedSourceFiles), global::Tensorflow.DebuggedSourceFiles.Parser, new[]{ "SourceFiles" }, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Option for watching a node in TensorFlow Debugger (tfdbg). + /// + public sealed partial class DebugTensorWatch : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DebugTensorWatch()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.DebugReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebugTensorWatch() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebugTensorWatch(DebugTensorWatch other) : this() { + nodeName_ = other.nodeName_; + outputSlot_ = other.outputSlot_; + debugOps_ = other.debugOps_.Clone(); + debugUrls_ = other.debugUrls_.Clone(); + tolerateDebugOpCreationFailures_ = other.tolerateDebugOpCreationFailures_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebugTensorWatch Clone() { + return new DebugTensorWatch(this); + } + + /// Field number for the "node_name" field. + public const int NodeNameFieldNumber = 1; + private string nodeName_ = ""; + /// + /// Name of the node to watch. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string NodeName { + get { return nodeName_; } + set { + nodeName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "output_slot" field. + public const int OutputSlotFieldNumber = 2; + private int outputSlot_; + /// + /// Output slot to watch. + /// The semantics of output_slot == -1 is that the node is only watched for + /// completion, but not for any output tensors. See NodeCompletionCallback + /// in debug_gateway.h. + /// TODO(cais): Implement this semantics. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int OutputSlot { + get { return outputSlot_; } + set { + outputSlot_ = value; + } + } + + /// Field number for the "debug_ops" field. + public const int DebugOpsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_debugOps_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField debugOps_ = new pbc::RepeatedField(); + /// + /// Name(s) of the debugging op(s). + /// One or more than one probes on a tensor. + /// e.g., {"DebugIdentity", "DebugNanCount"} + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DebugOps { + get { return debugOps_; } + } + + /// Field number for the "debug_urls" field. + public const int DebugUrlsFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_debugUrls_codec + = pb::FieldCodec.ForString(34); + private readonly pbc::RepeatedField debugUrls_ = new pbc::RepeatedField(); + /// + /// URL(s) for debug targets(s). + /// + /// Supported URL formats are: + /// - file:///foo/tfdbg_dump: Writes out Event content to file + /// /foo/tfdbg_dump. Assumes all directories can be created if they don't + /// already exist. + /// - grpc://localhost:11011: Sends an RPC request to an EventListener + /// service running at localhost:11011 with the event. + /// - memcbk:///event_key: Routes tensors to clients using the + /// callback registered with the DebugCallbackRegistry for event_key. + /// + /// Each debug op listed in debug_ops will publish its output tensor (debug + /// signal) to all URLs in debug_urls. + /// + /// N.B. Session::Run() supports concurrent invocations of the same inputs + /// (feed keys), outputs and target nodes. If such concurrent invocations + /// are to be debugged, the callers of Session::Run() must use distinct + /// debug_urls to make sure that the streamed or dumped events do not overlap + /// among the invocations. + /// TODO(cais): More visible documentation of this in g3docs. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DebugUrls { + get { return debugUrls_; } + } + + /// Field number for the "tolerate_debug_op_creation_failures" field. + public const int TolerateDebugOpCreationFailuresFieldNumber = 5; + private bool tolerateDebugOpCreationFailures_; + /// + /// Do not error out if debug op creation fails (e.g., due to dtype + /// incompatibility). Instead, just log the failure. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool TolerateDebugOpCreationFailures { + get { return tolerateDebugOpCreationFailures_; } + set { + tolerateDebugOpCreationFailures_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DebugTensorWatch); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DebugTensorWatch other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NodeName != other.NodeName) return false; + if (OutputSlot != other.OutputSlot) return false; + if(!debugOps_.Equals(other.debugOps_)) return false; + if(!debugUrls_.Equals(other.debugUrls_)) return false; + if (TolerateDebugOpCreationFailures != other.TolerateDebugOpCreationFailures) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (NodeName.Length != 0) hash ^= NodeName.GetHashCode(); + if (OutputSlot != 0) hash ^= OutputSlot.GetHashCode(); + hash ^= debugOps_.GetHashCode(); + hash ^= debugUrls_.GetHashCode(); + if (TolerateDebugOpCreationFailures != false) hash ^= TolerateDebugOpCreationFailures.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (NodeName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(NodeName); + } + if (OutputSlot != 0) { + output.WriteRawTag(16); + output.WriteInt32(OutputSlot); + } + debugOps_.WriteTo(output, _repeated_debugOps_codec); + debugUrls_.WriteTo(output, _repeated_debugUrls_codec); + if (TolerateDebugOpCreationFailures != false) { + output.WriteRawTag(40); + output.WriteBool(TolerateDebugOpCreationFailures); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (NodeName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(NodeName); + } + if (OutputSlot != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputSlot); + } + size += debugOps_.CalculateSize(_repeated_debugOps_codec); + size += debugUrls_.CalculateSize(_repeated_debugUrls_codec); + if (TolerateDebugOpCreationFailures != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DebugTensorWatch other) { + if (other == null) { + return; + } + if (other.NodeName.Length != 0) { + NodeName = other.NodeName; + } + if (other.OutputSlot != 0) { + OutputSlot = other.OutputSlot; + } + debugOps_.Add(other.debugOps_); + debugUrls_.Add(other.debugUrls_); + if (other.TolerateDebugOpCreationFailures != false) { + TolerateDebugOpCreationFailures = other.TolerateDebugOpCreationFailures; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + NodeName = input.ReadString(); + break; + } + case 16: { + OutputSlot = input.ReadInt32(); + break; + } + case 26: { + debugOps_.AddEntriesFrom(input, _repeated_debugOps_codec); + break; + } + case 34: { + debugUrls_.AddEntriesFrom(input, _repeated_debugUrls_codec); + break; + } + case 40: { + TolerateDebugOpCreationFailures = input.ReadBool(); + break; + } + } + } + } + + } + + /// + /// Options for initializing DebuggerState in TensorFlow Debugger (tfdbg). + /// + public sealed partial class DebugOptions : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DebugOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.DebugReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebugOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebugOptions(DebugOptions other) : this() { + debugTensorWatchOpts_ = other.debugTensorWatchOpts_.Clone(); + globalStep_ = other.globalStep_; + resetDiskByteUsage_ = other.resetDiskByteUsage_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebugOptions Clone() { + return new DebugOptions(this); + } + + /// Field number for the "debug_tensor_watch_opts" field. + public const int DebugTensorWatchOptsFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_debugTensorWatchOpts_codec + = pb::FieldCodec.ForMessage(34, global::Tensorflow.DebugTensorWatch.Parser); + private readonly pbc::RepeatedField debugTensorWatchOpts_ = new pbc::RepeatedField(); + /// + /// Debugging options + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DebugTensorWatchOpts { + get { return debugTensorWatchOpts_; } + } + + /// Field number for the "global_step" field. + public const int GlobalStepFieldNumber = 10; + private long globalStep_; + /// + /// Caller-specified global step count. + /// Note that this is distinct from the session run count and the executor + /// step count. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long GlobalStep { + get { return globalStep_; } + set { + globalStep_ = value; + } + } + + /// Field number for the "reset_disk_byte_usage" field. + public const int ResetDiskByteUsageFieldNumber = 11; + private bool resetDiskByteUsage_; + /// + /// Whether the total disk usage of tfdbg is to be reset to zero + /// in this Session.run call. This is used by wrappers and hooks + /// such as the local CLI ones to indicate that the dumped tensors + /// are cleaned up from the disk after each Session.run. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool ResetDiskByteUsage { + get { return resetDiskByteUsage_; } + set { + resetDiskByteUsage_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DebugOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DebugOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!debugTensorWatchOpts_.Equals(other.debugTensorWatchOpts_)) return false; + if (GlobalStep != other.GlobalStep) return false; + if (ResetDiskByteUsage != other.ResetDiskByteUsage) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= debugTensorWatchOpts_.GetHashCode(); + if (GlobalStep != 0L) hash ^= GlobalStep.GetHashCode(); + if (ResetDiskByteUsage != false) hash ^= ResetDiskByteUsage.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + debugTensorWatchOpts_.WriteTo(output, _repeated_debugTensorWatchOpts_codec); + if (GlobalStep != 0L) { + output.WriteRawTag(80); + output.WriteInt64(GlobalStep); + } + if (ResetDiskByteUsage != false) { + output.WriteRawTag(88); + output.WriteBool(ResetDiskByteUsage); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += debugTensorWatchOpts_.CalculateSize(_repeated_debugTensorWatchOpts_codec); + if (GlobalStep != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(GlobalStep); + } + if (ResetDiskByteUsage != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DebugOptions other) { + if (other == null) { + return; + } + debugTensorWatchOpts_.Add(other.debugTensorWatchOpts_); + if (other.GlobalStep != 0L) { + GlobalStep = other.GlobalStep; + } + if (other.ResetDiskByteUsage != false) { + ResetDiskByteUsage = other.ResetDiskByteUsage; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 34: { + debugTensorWatchOpts_.AddEntriesFrom(input, _repeated_debugTensorWatchOpts_codec); + break; + } + case 80: { + GlobalStep = input.ReadInt64(); + break; + } + case 88: { + ResetDiskByteUsage = input.ReadBool(); + break; + } + } + } + } + + } + + public sealed partial class DebuggedSourceFile : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DebuggedSourceFile()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.DebugReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebuggedSourceFile() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebuggedSourceFile(DebuggedSourceFile other) : this() { + host_ = other.host_; + filePath_ = other.filePath_; + lastModified_ = other.lastModified_; + bytes_ = other.bytes_; + lines_ = other.lines_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebuggedSourceFile Clone() { + return new DebuggedSourceFile(this); + } + + /// Field number for the "host" field. + public const int HostFieldNumber = 1; + private string host_ = ""; + /// + /// The host name on which a source code file is located. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Host { + get { return host_; } + set { + host_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "file_path" field. + public const int FilePathFieldNumber = 2; + private string filePath_ = ""; + /// + /// Path to the source code file. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string FilePath { + get { return filePath_; } + set { + filePath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "last_modified" field. + public const int LastModifiedFieldNumber = 3; + private long lastModified_; + /// + /// The timestamp at which the source code file is last modified. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long LastModified { + get { return lastModified_; } + set { + lastModified_ = value; + } + } + + /// Field number for the "bytes" field. + public const int BytesFieldNumber = 4; + private long bytes_; + /// + /// Byte size of the file. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Bytes { + get { return bytes_; } + set { + bytes_ = value; + } + } + + /// Field number for the "lines" field. + public const int LinesFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_lines_codec + = pb::FieldCodec.ForString(42); + private readonly pbc::RepeatedField lines_ = new pbc::RepeatedField(); + /// + /// Line-by-line content of the source code file. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Lines { + get { return lines_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DebuggedSourceFile); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DebuggedSourceFile other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Host != other.Host) return false; + if (FilePath != other.FilePath) return false; + if (LastModified != other.LastModified) return false; + if (Bytes != other.Bytes) return false; + if(!lines_.Equals(other.lines_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Host.Length != 0) hash ^= Host.GetHashCode(); + if (FilePath.Length != 0) hash ^= FilePath.GetHashCode(); + if (LastModified != 0L) hash ^= LastModified.GetHashCode(); + if (Bytes != 0L) hash ^= Bytes.GetHashCode(); + hash ^= lines_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Host.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Host); + } + if (FilePath.Length != 0) { + output.WriteRawTag(18); + output.WriteString(FilePath); + } + if (LastModified != 0L) { + output.WriteRawTag(24); + output.WriteInt64(LastModified); + } + if (Bytes != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Bytes); + } + lines_.WriteTo(output, _repeated_lines_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Host.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Host); + } + if (FilePath.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FilePath); + } + if (LastModified != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(LastModified); + } + if (Bytes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Bytes); + } + size += lines_.CalculateSize(_repeated_lines_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DebuggedSourceFile other) { + if (other == null) { + return; + } + if (other.Host.Length != 0) { + Host = other.Host; + } + if (other.FilePath.Length != 0) { + FilePath = other.FilePath; + } + if (other.LastModified != 0L) { + LastModified = other.LastModified; + } + if (other.Bytes != 0L) { + Bytes = other.Bytes; + } + lines_.Add(other.lines_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Host = input.ReadString(); + break; + } + case 18: { + FilePath = input.ReadString(); + break; + } + case 24: { + LastModified = input.ReadInt64(); + break; + } + case 32: { + Bytes = input.ReadInt64(); + break; + } + case 42: { + lines_.AddEntriesFrom(input, _repeated_lines_codec); + break; + } + } + } + } + + } + + public sealed partial class DebuggedSourceFiles : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DebuggedSourceFiles()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.DebugReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebuggedSourceFiles() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebuggedSourceFiles(DebuggedSourceFiles other) : this() { + sourceFiles_ = other.sourceFiles_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DebuggedSourceFiles Clone() { + return new DebuggedSourceFiles(this); + } + + /// Field number for the "source_files" field. + public const int SourceFilesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_sourceFiles_codec + = pb::FieldCodec.ForMessage(10, global::Tensorflow.DebuggedSourceFile.Parser); + private readonly pbc::RepeatedField sourceFiles_ = new pbc::RepeatedField(); + /// + /// A collection of source code files. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField SourceFiles { + get { return sourceFiles_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DebuggedSourceFiles); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DebuggedSourceFiles other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!sourceFiles_.Equals(other.sourceFiles_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= sourceFiles_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + sourceFiles_.WriteTo(output, _repeated_sourceFiles_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += sourceFiles_.CalculateSize(_repeated_sourceFiles_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DebuggedSourceFiles other) { + if (other == null) { + return; + } + sourceFiles_.Add(other.sourceFiles_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + sourceFiles_.AddEntriesFrom(input, _repeated_sourceFiles_codec); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/DeviceAttributes.cs b/src/TensorFlowNET.Core/Protobuf/DeviceAttributes.cs new file mode 100644 index 00000000..aafe9dfd --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/DeviceAttributes.cs @@ -0,0 +1,860 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/device_attributes.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/device_attributes.proto + public static partial class DeviceAttributesReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/device_attributes.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static DeviceAttributesReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjF0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2RldmljZV9hdHRyaWJ1dGVz", + "LnByb3RvEgp0ZW5zb3JmbG93IkUKEEludGVyY29ubmVjdExpbmsSEQoJZGV2", + "aWNlX2lkGAEgASgFEgwKBHR5cGUYAiABKAkSEAoIc3RyZW5ndGgYAyABKAUi", + "OAoKTG9jYWxMaW5rcxIqCgRsaW5rGAEgAygLMhwudGVuc29yZmxvdy5JbnRl", + "cmNvbm5lY3RMaW5rIloKDkRldmljZUxvY2FsaXR5Eg4KBmJ1c19pZBgBIAEo", + "BRIRCgludW1hX25vZGUYAiABKAUSJQoFbGlua3MYAyABKAsyFi50ZW5zb3Jm", + "bG93LkxvY2FsTGlua3MirAEKEERldmljZUF0dHJpYnV0ZXMSDAoEbmFtZRgB", + "IAEoCRITCgtkZXZpY2VfdHlwZRgCIAEoCRIUCgxtZW1vcnlfbGltaXQYBCAB", + "KAMSLAoIbG9jYWxpdHkYBSABKAsyGi50ZW5zb3JmbG93LkRldmljZUxvY2Fs", + "aXR5EhMKC2luY2FybmF0aW9uGAYgASgGEhwKFHBoeXNpY2FsX2RldmljZV9k", + "ZXNjGAcgASgJQnYKGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IWRGV2aWNl", + "QXR0cmlidXRlc1Byb3Rvc1ABWj1naXRodWIuY29tL3RlbnNvcmZsb3cvdGVu", + "c29yZmxvdy90ZW5zb3JmbG93L2dvL2NvcmUvZnJhbWV3b3Jr+AEBYgZwcm90", + "bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.InterconnectLink), global::Tensorflow.InterconnectLink.Parser, new[]{ "DeviceId", "Type", "Strength" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.LocalLinks), global::Tensorflow.LocalLinks.Parser, new[]{ "Link" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DeviceLocality), global::Tensorflow.DeviceLocality.Parser, new[]{ "BusId", "NumaNode", "Links" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DeviceAttributes), global::Tensorflow.DeviceAttributes.Parser, new[]{ "Name", "DeviceType", "MemoryLimit", "Locality", "Incarnation", "PhysicalDeviceDesc" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class InterconnectLink : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InterconnectLink()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.DeviceAttributesReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InterconnectLink() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InterconnectLink(InterconnectLink other) : this() { + deviceId_ = other.deviceId_; + type_ = other.type_; + strength_ = other.strength_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public InterconnectLink Clone() { + return new InterconnectLink(this); + } + + /// Field number for the "device_id" field. + public const int DeviceIdFieldNumber = 1; + private int deviceId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int DeviceId { + get { return deviceId_; } + set { + deviceId_ = value; + } + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 2; + private string type_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Type { + get { return type_; } + set { + type_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "strength" field. + public const int StrengthFieldNumber = 3; + private int strength_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Strength { + get { return strength_; } + set { + strength_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as InterconnectLink); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(InterconnectLink other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (DeviceId != other.DeviceId) return false; + if (Type != other.Type) return false; + if (Strength != other.Strength) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (DeviceId != 0) hash ^= DeviceId.GetHashCode(); + if (Type.Length != 0) hash ^= Type.GetHashCode(); + if (Strength != 0) hash ^= Strength.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (DeviceId != 0) { + output.WriteRawTag(8); + output.WriteInt32(DeviceId); + } + if (Type.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Type); + } + if (Strength != 0) { + output.WriteRawTag(24); + output.WriteInt32(Strength); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (DeviceId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(DeviceId); + } + if (Type.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Type); + } + if (Strength != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Strength); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(InterconnectLink other) { + if (other == null) { + return; + } + if (other.DeviceId != 0) { + DeviceId = other.DeviceId; + } + if (other.Type.Length != 0) { + Type = other.Type; + } + if (other.Strength != 0) { + Strength = other.Strength; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + DeviceId = input.ReadInt32(); + break; + } + case 18: { + Type = input.ReadString(); + break; + } + case 24: { + Strength = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class LocalLinks : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LocalLinks()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.DeviceAttributesReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public LocalLinks() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public LocalLinks(LocalLinks other) : this() { + link_ = other.link_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public LocalLinks Clone() { + return new LocalLinks(this); + } + + /// Field number for the "link" field. + public const int LinkFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_link_codec + = pb::FieldCodec.ForMessage(10, global::Tensorflow.InterconnectLink.Parser); + private readonly pbc::RepeatedField link_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Link { + get { return link_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as LocalLinks); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(LocalLinks other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!link_.Equals(other.link_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= link_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + link_.WriteTo(output, _repeated_link_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += link_.CalculateSize(_repeated_link_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(LocalLinks other) { + if (other == null) { + return; + } + link_.Add(other.link_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + link_.AddEntriesFrom(input, _repeated_link_codec); + break; + } + } + } + } + + } + + public sealed partial class DeviceLocality : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeviceLocality()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.DeviceAttributesReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DeviceLocality() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DeviceLocality(DeviceLocality other) : this() { + busId_ = other.busId_; + numaNode_ = other.numaNode_; + links_ = other.links_ != null ? other.links_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DeviceLocality Clone() { + return new DeviceLocality(this); + } + + /// Field number for the "bus_id" field. + public const int BusIdFieldNumber = 1; + private int busId_; + /// + /// Optional bus locality of device. Default value of 0 means + /// no specific locality. Specific localities are indexed from 1. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int BusId { + get { return busId_; } + set { + busId_ = value; + } + } + + /// Field number for the "numa_node" field. + public const int NumaNodeFieldNumber = 2; + private int numaNode_; + /// + /// Optional NUMA locality of device. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int NumaNode { + get { return numaNode_; } + set { + numaNode_ = value; + } + } + + /// Field number for the "links" field. + public const int LinksFieldNumber = 3; + private global::Tensorflow.LocalLinks links_; + /// + /// Optional local interconnect links to other devices. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.LocalLinks Links { + get { return links_; } + set { + links_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DeviceLocality); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DeviceLocality other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (BusId != other.BusId) return false; + if (NumaNode != other.NumaNode) return false; + if (!object.Equals(Links, other.Links)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (BusId != 0) hash ^= BusId.GetHashCode(); + if (NumaNode != 0) hash ^= NumaNode.GetHashCode(); + if (links_ != null) hash ^= Links.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (BusId != 0) { + output.WriteRawTag(8); + output.WriteInt32(BusId); + } + if (NumaNode != 0) { + output.WriteRawTag(16); + output.WriteInt32(NumaNode); + } + if (links_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Links); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (BusId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(BusId); + } + if (NumaNode != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumaNode); + } + if (links_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Links); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DeviceLocality other) { + if (other == null) { + return; + } + if (other.BusId != 0) { + BusId = other.BusId; + } + if (other.NumaNode != 0) { + NumaNode = other.NumaNode; + } + if (other.links_ != null) { + if (links_ == null) { + links_ = new global::Tensorflow.LocalLinks(); + } + Links.MergeFrom(other.Links); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + BusId = input.ReadInt32(); + break; + } + case 16: { + NumaNode = input.ReadInt32(); + break; + } + case 26: { + if (links_ == null) { + links_ = new global::Tensorflow.LocalLinks(); + } + input.ReadMessage(links_); + break; + } + } + } + } + + } + + public sealed partial class DeviceAttributes : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeviceAttributes()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.DeviceAttributesReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DeviceAttributes() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DeviceAttributes(DeviceAttributes other) : this() { + name_ = other.name_; + deviceType_ = other.deviceType_; + memoryLimit_ = other.memoryLimit_; + locality_ = other.locality_ != null ? other.locality_.Clone() : null; + incarnation_ = other.incarnation_; + physicalDeviceDesc_ = other.physicalDeviceDesc_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DeviceAttributes Clone() { + return new DeviceAttributes(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// Fully specified name of the device within a cluster. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "device_type" field. + public const int DeviceTypeFieldNumber = 2; + private string deviceType_ = ""; + /// + /// String representation of device_type. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string DeviceType { + get { return deviceType_; } + set { + deviceType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "memory_limit" field. + public const int MemoryLimitFieldNumber = 4; + private long memoryLimit_; + /// + /// Memory capacity of device in bytes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long MemoryLimit { + get { return memoryLimit_; } + set { + memoryLimit_ = value; + } + } + + /// Field number for the "locality" field. + public const int LocalityFieldNumber = 5; + private global::Tensorflow.DeviceLocality locality_; + /// + /// Platform-specific data about device that may be useful + /// for supporting efficient data transfers. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.DeviceLocality Locality { + get { return locality_; } + set { + locality_ = value; + } + } + + /// Field number for the "incarnation" field. + public const int IncarnationFieldNumber = 6; + private ulong incarnation_; + /// + /// A device is assigned a global unique number each time it is + /// initialized. "incarnation" should never be 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ulong Incarnation { + get { return incarnation_; } + set { + incarnation_ = value; + } + } + + /// Field number for the "physical_device_desc" field. + public const int PhysicalDeviceDescFieldNumber = 7; + private string physicalDeviceDesc_ = ""; + /// + /// String representation of the physical device that this device maps to. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string PhysicalDeviceDesc { + get { return physicalDeviceDesc_; } + set { + physicalDeviceDesc_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DeviceAttributes); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DeviceAttributes other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (DeviceType != other.DeviceType) return false; + if (MemoryLimit != other.MemoryLimit) return false; + if (!object.Equals(Locality, other.Locality)) return false; + if (Incarnation != other.Incarnation) return false; + if (PhysicalDeviceDesc != other.PhysicalDeviceDesc) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (DeviceType.Length != 0) hash ^= DeviceType.GetHashCode(); + if (MemoryLimit != 0L) hash ^= MemoryLimit.GetHashCode(); + if (locality_ != null) hash ^= Locality.GetHashCode(); + if (Incarnation != 0UL) hash ^= Incarnation.GetHashCode(); + if (PhysicalDeviceDesc.Length != 0) hash ^= PhysicalDeviceDesc.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (DeviceType.Length != 0) { + output.WriteRawTag(18); + output.WriteString(DeviceType); + } + if (MemoryLimit != 0L) { + output.WriteRawTag(32); + output.WriteInt64(MemoryLimit); + } + if (locality_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Locality); + } + if (Incarnation != 0UL) { + output.WriteRawTag(49); + output.WriteFixed64(Incarnation); + } + if (PhysicalDeviceDesc.Length != 0) { + output.WriteRawTag(58); + output.WriteString(PhysicalDeviceDesc); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (DeviceType.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DeviceType); + } + if (MemoryLimit != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(MemoryLimit); + } + if (locality_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Locality); + } + if (Incarnation != 0UL) { + size += 1 + 8; + } + if (PhysicalDeviceDesc.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(PhysicalDeviceDesc); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DeviceAttributes other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.DeviceType.Length != 0) { + DeviceType = other.DeviceType; + } + if (other.MemoryLimit != 0L) { + MemoryLimit = other.MemoryLimit; + } + if (other.locality_ != null) { + if (locality_ == null) { + locality_ = new global::Tensorflow.DeviceLocality(); + } + Locality.MergeFrom(other.Locality); + } + if (other.Incarnation != 0UL) { + Incarnation = other.Incarnation; + } + if (other.PhysicalDeviceDesc.Length != 0) { + PhysicalDeviceDesc = other.PhysicalDeviceDesc; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + DeviceType = input.ReadString(); + break; + } + case 32: { + MemoryLimit = input.ReadInt64(); + break; + } + case 42: { + if (locality_ == null) { + locality_ = new global::Tensorflow.DeviceLocality(); + } + input.ReadMessage(locality_); + break; + } + case 49: { + Incarnation = input.ReadFixed64(); + break; + } + case 58: { + PhysicalDeviceDesc = input.ReadString(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/Function.cs b/src/TensorFlowNET.Core/Protobuf/Function.cs index 4aac8252..22a9011b 100644 --- a/src/TensorFlowNET.Core/Protobuf/Function.cs +++ b/src/TensorFlowNET.Core/Protobuf/Function.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: function.proto +// source: tensorflow/core/framework/function.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Tensorflow { - /// Holder for reflection information generated from function.proto + /// Holder for reflection information generated from tensorflow/core/framework/function.proto public static partial class FunctionReflection { #region Descriptor - /// File descriptor for function.proto + /// File descriptor for tensorflow/core/framework/function.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,21 +24,24 @@ namespace Tensorflow { static FunctionReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cg5mdW5jdGlvbi5wcm90bxIKdGVuc29yZmxvdxoQYXR0cl92YWx1ZS5wcm90", - "bxoObm9kZV9kZWYucHJvdG8aDG9wX2RlZi5wcm90byJqChJGdW5jdGlvbkRl", - "ZkxpYnJhcnkSKQoIZnVuY3Rpb24YASADKAsyFy50ZW5zb3JmbG93LkZ1bmN0", - "aW9uRGVmEikKCGdyYWRpZW50GAIgAygLMhcudGVuc29yZmxvdy5HcmFkaWVu", - "dERlZiKwAgoLRnVuY3Rpb25EZWYSJAoJc2lnbmF0dXJlGAEgASgLMhEudGVu", - "c29yZmxvdy5PcERlZhIvCgRhdHRyGAUgAygLMiEudGVuc29yZmxvdy5GdW5j", - "dGlvbkRlZi5BdHRyRW50cnkSJQoIbm9kZV9kZWYYAyADKAsyEy50ZW5zb3Jm", - "bG93Lk5vZGVEZWYSLQoDcmV0GAQgAygLMiAudGVuc29yZmxvdy5GdW5jdGlv", - "bkRlZi5SZXRFbnRyeRpCCglBdHRyRW50cnkSCwoDa2V5GAEgASgJEiQKBXZh", - "bHVlGAIgASgLMhUudGVuc29yZmxvdy5BdHRyVmFsdWU6AjgBGioKCFJldEVu", - "dHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAFKBAgCEAMiOwoL", - "R3JhZGllbnREZWYSFQoNZnVuY3Rpb25fbmFtZRgBIAEoCRIVCg1ncmFkaWVu", - "dF9mdW5jGAIgASgJQm4KGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IORnVu", - "Y3Rpb25Qcm90b3NQAVo9Z2l0aHViLmNvbS90ZW5zb3JmbG93L3RlbnNvcmZs", - "b3cvdGVuc29yZmxvdy9nby9jb3JlL2ZyYW1ld29ya/gBAWIGcHJvdG8z")); + "Cih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2Z1bmN0aW9uLnByb3RvEgp0", + "ZW5zb3JmbG93Gip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2F0dHJfdmFs", + "dWUucHJvdG8aKHRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvbm9kZV9kZWYu", + "cHJvdG8aJnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvb3BfZGVmLnByb3Rv", + "ImoKEkZ1bmN0aW9uRGVmTGlicmFyeRIpCghmdW5jdGlvbhgBIAMoCzIXLnRl", + "bnNvcmZsb3cuRnVuY3Rpb25EZWYSKQoIZ3JhZGllbnQYAiADKAsyFy50ZW5z", + "b3JmbG93LkdyYWRpZW50RGVmIrACCgtGdW5jdGlvbkRlZhIkCglzaWduYXR1", + "cmUYASABKAsyES50ZW5zb3JmbG93Lk9wRGVmEi8KBGF0dHIYBSADKAsyIS50", + "ZW5zb3JmbG93LkZ1bmN0aW9uRGVmLkF0dHJFbnRyeRIlCghub2RlX2RlZhgD", + "IAMoCzITLnRlbnNvcmZsb3cuTm9kZURlZhItCgNyZXQYBCADKAsyIC50ZW5z", + "b3JmbG93LkZ1bmN0aW9uRGVmLlJldEVudHJ5GkIKCUF0dHJFbnRyeRILCgNr", + "ZXkYASABKAkSJAoFdmFsdWUYAiABKAsyFS50ZW5zb3JmbG93LkF0dHJWYWx1", + "ZToCOAEaKgoIUmV0RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJ", + "OgI4AUoECAIQAyI7CgtHcmFkaWVudERlZhIVCg1mdW5jdGlvbl9uYW1lGAEg", + "ASgJEhUKDWdyYWRpZW50X2Z1bmMYAiABKAlCbgoYb3JnLnRlbnNvcmZsb3cu", + "ZnJhbWV3b3JrQg5GdW5jdGlvblByb3Rvc1ABWj1naXRodWIuY29tL3RlbnNv", + "cmZsb3cvdGVuc29yZmxvdy90ZW5zb3JmbG93L2dvL2NvcmUvZnJhbWV3b3Jr", + "+AEBYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tensorflow.AttrValueReflection.Descriptor, global::Tensorflow.NodeDefReflection.Descriptor, global::Tensorflow.OpDefReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { diff --git a/src/TensorFlowNET.Core/Protobuf/Graph.cs b/src/TensorFlowNET.Core/Protobuf/Graph.cs index 3dce73f1..a55e6d0f 100644 --- a/src/TensorFlowNET.Core/Protobuf/Graph.cs +++ b/src/TensorFlowNET.Core/Protobuf/Graph.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: graph.proto +// source: tensorflow/core/framework/graph.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Tensorflow { - /// Holder for reflection information generated from graph.proto + /// Holder for reflection information generated from tensorflow/core/framework/graph.proto public static partial class GraphReflection { #region Descriptor - /// File descriptor for graph.proto + /// File descriptor for tensorflow/core/framework/graph.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,14 +24,17 @@ namespace Tensorflow { static GraphReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CgtncmFwaC5wcm90bxIKdGVuc29yZmxvdxoObm9kZV9kZWYucHJvdG8aDmZ1", - "bmN0aW9uLnByb3RvGg52ZXJzaW9ucy5wcm90byKdAQoIR3JhcGhEZWYSIQoE", - "bm9kZRgBIAMoCzITLnRlbnNvcmZsb3cuTm9kZURlZhIoCgh2ZXJzaW9ucxgE", - "IAEoCzIWLnRlbnNvcmZsb3cuVmVyc2lvbkRlZhITCgd2ZXJzaW9uGAMgASgF", - "QgIYARIvCgdsaWJyYXJ5GAIgASgLMh4udGVuc29yZmxvdy5GdW5jdGlvbkRl", - "ZkxpYnJhcnlCawoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQgtHcmFwaFBy", - "b3Rvc1ABWj1naXRodWIuY29tL3RlbnNvcmZsb3cvdGVuc29yZmxvdy90ZW5z", - "b3JmbG93L2dvL2NvcmUvZnJhbWV3b3Jr+AEBYgZwcm90bzM=")); + "CiV0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2dyYXBoLnByb3RvEgp0ZW5z", + "b3JmbG93Gih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL25vZGVfZGVmLnBy", + "b3RvGih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2Z1bmN0aW9uLnByb3Rv", + "Gih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3ZlcnNpb25zLnByb3RvIp0B", + "CghHcmFwaERlZhIhCgRub2RlGAEgAygLMhMudGVuc29yZmxvdy5Ob2RlRGVm", + "EigKCHZlcnNpb25zGAQgASgLMhYudGVuc29yZmxvdy5WZXJzaW9uRGVmEhMK", + "B3ZlcnNpb24YAyABKAVCAhgBEi8KB2xpYnJhcnkYAiABKAsyHi50ZW5zb3Jm", + "bG93LkZ1bmN0aW9uRGVmTGlicmFyeUJrChhvcmcudGVuc29yZmxvdy5mcmFt", + "ZXdvcmtCC0dyYXBoUHJvdG9zUAFaPWdpdGh1Yi5jb20vdGVuc29yZmxvdy90", + "ZW5zb3JmbG93L3RlbnNvcmZsb3cvZ28vY29yZS9mcmFtZXdvcmv4AQFiBnBy", + "b3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tensorflow.NodeDefReflection.Descriptor, global::Tensorflow.FunctionReflection.Descriptor, global::Tensorflow.VersionsReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { diff --git a/src/TensorFlowNET.Core/Protobuf/GraphTransferInfo.cs b/src/TensorFlowNET.Core/Protobuf/GraphTransferInfo.cs new file mode 100644 index 00000000..579dae23 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/GraphTransferInfo.cs @@ -0,0 +1,1697 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/graph_transfer_info.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/graph_transfer_info.proto + public static partial class GraphTransferInfoReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/graph_transfer_info.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static GraphTransferInfoReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjN0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2dyYXBoX3RyYW5zZmVyX2lu", + "Zm8ucHJvdG8SCnRlbnNvcmZsb3caJXRlbnNvcmZsb3cvY29yZS9mcmFtZXdv", + "cmsvdHlwZXMucHJvdG8iPgoWR3JhcGhUcmFuc2Zlck5vZGVJbnB1dBIPCgdu", + "b2RlX2lkGAEgASgFEhMKC291dHB1dF9wb3J0GAIgASgFIpsBChVHcmFwaFRy", + "YW5zZmVyTm9kZUluZm8SDAoEbmFtZRgBIAEoCRIPCgdub2RlX2lkGAIgASgF", + "EhEKCXR5cGVfbmFtZRgDIAEoCRIRCglzb2Nfb3BfaWQYBCABKAUSEgoKcGFk", + "ZGluZ19pZBgFIAEoBRITCgtpbnB1dF9jb3VudBgGIAEoBRIUCgxvdXRwdXRf", + "Y291bnQYByABKAUifQoaR3JhcGhUcmFuc2ZlckNvbnN0Tm9kZUluZm8SDAoE", + "bmFtZRgBIAEoCRIPCgdub2RlX2lkGAIgASgFEg0KBXNoYXBlGAMgAygDEgwK", + "BGRhdGEYBCABKAwSIwoFZHR5cGUYBSABKA4yFC50ZW5zb3JmbG93LkRhdGFU", + "eXBlImUKGkdyYXBoVHJhbnNmZXJOb2RlSW5wdXRJbmZvEg8KB25vZGVfaWQY", + "ASABKAUSNgoKbm9kZV9pbnB1dBgCIAMoCzIiLnRlbnNvcmZsb3cuR3JhcGhU", + "cmFuc2Zlck5vZGVJbnB1dCJFChtHcmFwaFRyYW5zZmVyTm9kZU91dHB1dElu", + "Zm8SDwoHbm9kZV9pZBgBIAEoBRIVCg1tYXhfYnl0ZV9zaXplGAIgAygFImMK", + "H0dyYXBoVHJhbnNmZXJHcmFwaElucHV0Tm9kZUluZm8SDAoEbmFtZRgBIAEo", + "CRINCgVzaGFwZRgCIAMoAxIjCgVkdHlwZRgDIAEoDjIULnRlbnNvcmZsb3cu", + "RGF0YVR5cGUiZAogR3JhcGhUcmFuc2ZlckdyYXBoT3V0cHV0Tm9kZUluZm8S", + "DAoEbmFtZRgBIAEoCRINCgVzaGFwZRgCIAMoAxIjCgVkdHlwZRgDIAEoDjIU", + "LnRlbnNvcmZsb3cuRGF0YVR5cGUijQQKEUdyYXBoVHJhbnNmZXJJbmZvEjQK", + "CW5vZGVfaW5mbxgBIAMoCzIhLnRlbnNvcmZsb3cuR3JhcGhUcmFuc2Zlck5v", + "ZGVJbmZvEj8KD2NvbnN0X25vZGVfaW5mbxgCIAMoCzImLnRlbnNvcmZsb3cu", + "R3JhcGhUcmFuc2ZlckNvbnN0Tm9kZUluZm8SPwoPbm9kZV9pbnB1dF9pbmZv", + "GAMgAygLMiYudGVuc29yZmxvdy5HcmFwaFRyYW5zZmVyTm9kZUlucHV0SW5m", + "bxJBChBub2RlX291dHB1dF9pbmZvGAQgAygLMicudGVuc29yZmxvdy5HcmFw", + "aFRyYW5zZmVyTm9kZU91dHB1dEluZm8SSgoVZ3JhcGhfaW5wdXRfbm9kZV9p", + "bmZvGAUgAygLMisudGVuc29yZmxvdy5HcmFwaFRyYW5zZmVyR3JhcGhJbnB1", + "dE5vZGVJbmZvEkwKFmdyYXBoX291dHB1dF9ub2RlX2luZm8YBiADKAsyLC50", + "ZW5zb3JmbG93LkdyYXBoVHJhbnNmZXJHcmFwaE91dHB1dE5vZGVJbmZvEj4K", + "C2Rlc3RpbmF0aW9uGAcgASgOMikudGVuc29yZmxvdy5HcmFwaFRyYW5zZmVy", + "SW5mby5EZXN0aW5hdGlvbiIjCgtEZXN0aW5hdGlvbhIHCgNOT1AQABILCgdI", + "RVhBR09OEAFCdgoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQhZHcmFwaFRy", + "YW5zZmVySW5mb1Byb3RvUAFaPWdpdGh1Yi5jb20vdGVuc29yZmxvdy90ZW5z", + "b3JmbG93L3RlbnNvcmZsb3cvZ28vY29yZS9mcmFtZXdvcmv4AQFiBnByb3Rv", + "Mw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tensorflow.TypesReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GraphTransferNodeInput), global::Tensorflow.GraphTransferNodeInput.Parser, new[]{ "NodeId", "OutputPort" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GraphTransferNodeInfo), global::Tensorflow.GraphTransferNodeInfo.Parser, new[]{ "Name", "NodeId", "TypeName", "SocOpId", "PaddingId", "InputCount", "OutputCount" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GraphTransferConstNodeInfo), global::Tensorflow.GraphTransferConstNodeInfo.Parser, new[]{ "Name", "NodeId", "Shape", "Data", "Dtype" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GraphTransferNodeInputInfo), global::Tensorflow.GraphTransferNodeInputInfo.Parser, new[]{ "NodeId", "NodeInput" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GraphTransferNodeOutputInfo), global::Tensorflow.GraphTransferNodeOutputInfo.Parser, new[]{ "NodeId", "MaxByteSize" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GraphTransferGraphInputNodeInfo), global::Tensorflow.GraphTransferGraphInputNodeInfo.Parser, new[]{ "Name", "Shape", "Dtype" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GraphTransferGraphOutputNodeInfo), global::Tensorflow.GraphTransferGraphOutputNodeInfo.Parser, new[]{ "Name", "Shape", "Dtype" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.GraphTransferInfo), global::Tensorflow.GraphTransferInfo.Parser, new[]{ "NodeInfo", "ConstNodeInfo", "NodeInputInfo", "NodeOutputInfo", "GraphInputNodeInfo", "GraphOutputNodeInfo", "Destination" }, null, new[]{ typeof(global::Tensorflow.GraphTransferInfo.Types.Destination) }, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class GraphTransferNodeInput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphTransferNodeInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.GraphTransferInfoReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeInput(GraphTransferNodeInput other) : this() { + nodeId_ = other.nodeId_; + outputPort_ = other.outputPort_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeInput Clone() { + return new GraphTransferNodeInput(this); + } + + /// Field number for the "node_id" field. + public const int NodeIdFieldNumber = 1; + private int nodeId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int NodeId { + get { return nodeId_; } + set { + nodeId_ = value; + } + } + + /// Field number for the "output_port" field. + public const int OutputPortFieldNumber = 2; + private int outputPort_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int OutputPort { + get { return outputPort_; } + set { + outputPort_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GraphTransferNodeInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GraphTransferNodeInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NodeId != other.NodeId) return false; + if (OutputPort != other.OutputPort) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (NodeId != 0) hash ^= NodeId.GetHashCode(); + if (OutputPort != 0) hash ^= OutputPort.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (NodeId != 0) { + output.WriteRawTag(8); + output.WriteInt32(NodeId); + } + if (OutputPort != 0) { + output.WriteRawTag(16); + output.WriteInt32(OutputPort); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (NodeId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NodeId); + } + if (OutputPort != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputPort); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GraphTransferNodeInput other) { + if (other == null) { + return; + } + if (other.NodeId != 0) { + NodeId = other.NodeId; + } + if (other.OutputPort != 0) { + OutputPort = other.OutputPort; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NodeId = input.ReadInt32(); + break; + } + case 16: { + OutputPort = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class GraphTransferNodeInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphTransferNodeInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.GraphTransferInfoReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeInfo(GraphTransferNodeInfo other) : this() { + name_ = other.name_; + nodeId_ = other.nodeId_; + typeName_ = other.typeName_; + socOpId_ = other.socOpId_; + paddingId_ = other.paddingId_; + inputCount_ = other.inputCount_; + outputCount_ = other.outputCount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeInfo Clone() { + return new GraphTransferNodeInfo(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "node_id" field. + public const int NodeIdFieldNumber = 2; + private int nodeId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int NodeId { + get { return nodeId_; } + set { + nodeId_ = value; + } + } + + /// Field number for the "type_name" field. + public const int TypeNameFieldNumber = 3; + private string typeName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TypeName { + get { return typeName_; } + set { + typeName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "soc_op_id" field. + public const int SocOpIdFieldNumber = 4; + private int socOpId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int SocOpId { + get { return socOpId_; } + set { + socOpId_ = value; + } + } + + /// Field number for the "padding_id" field. + public const int PaddingIdFieldNumber = 5; + private int paddingId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PaddingId { + get { return paddingId_; } + set { + paddingId_ = value; + } + } + + /// Field number for the "input_count" field. + public const int InputCountFieldNumber = 6; + private int inputCount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int InputCount { + get { return inputCount_; } + set { + inputCount_ = value; + } + } + + /// Field number for the "output_count" field. + public const int OutputCountFieldNumber = 7; + private int outputCount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int OutputCount { + get { return outputCount_; } + set { + outputCount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GraphTransferNodeInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GraphTransferNodeInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (NodeId != other.NodeId) return false; + if (TypeName != other.TypeName) return false; + if (SocOpId != other.SocOpId) return false; + if (PaddingId != other.PaddingId) return false; + if (InputCount != other.InputCount) return false; + if (OutputCount != other.OutputCount) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (NodeId != 0) hash ^= NodeId.GetHashCode(); + if (TypeName.Length != 0) hash ^= TypeName.GetHashCode(); + if (SocOpId != 0) hash ^= SocOpId.GetHashCode(); + if (PaddingId != 0) hash ^= PaddingId.GetHashCode(); + if (InputCount != 0) hash ^= InputCount.GetHashCode(); + if (OutputCount != 0) hash ^= OutputCount.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (NodeId != 0) { + output.WriteRawTag(16); + output.WriteInt32(NodeId); + } + if (TypeName.Length != 0) { + output.WriteRawTag(26); + output.WriteString(TypeName); + } + if (SocOpId != 0) { + output.WriteRawTag(32); + output.WriteInt32(SocOpId); + } + if (PaddingId != 0) { + output.WriteRawTag(40); + output.WriteInt32(PaddingId); + } + if (InputCount != 0) { + output.WriteRawTag(48); + output.WriteInt32(InputCount); + } + if (OutputCount != 0) { + output.WriteRawTag(56); + output.WriteInt32(OutputCount); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (NodeId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NodeId); + } + if (TypeName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TypeName); + } + if (SocOpId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(SocOpId); + } + if (PaddingId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PaddingId); + } + if (InputCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InputCount); + } + if (OutputCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(OutputCount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GraphTransferNodeInfo other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.NodeId != 0) { + NodeId = other.NodeId; + } + if (other.TypeName.Length != 0) { + TypeName = other.TypeName; + } + if (other.SocOpId != 0) { + SocOpId = other.SocOpId; + } + if (other.PaddingId != 0) { + PaddingId = other.PaddingId; + } + if (other.InputCount != 0) { + InputCount = other.InputCount; + } + if (other.OutputCount != 0) { + OutputCount = other.OutputCount; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + NodeId = input.ReadInt32(); + break; + } + case 26: { + TypeName = input.ReadString(); + break; + } + case 32: { + SocOpId = input.ReadInt32(); + break; + } + case 40: { + PaddingId = input.ReadInt32(); + break; + } + case 48: { + InputCount = input.ReadInt32(); + break; + } + case 56: { + OutputCount = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class GraphTransferConstNodeInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphTransferConstNodeInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.GraphTransferInfoReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferConstNodeInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferConstNodeInfo(GraphTransferConstNodeInfo other) : this() { + name_ = other.name_; + nodeId_ = other.nodeId_; + shape_ = other.shape_.Clone(); + data_ = other.data_; + dtype_ = other.dtype_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferConstNodeInfo Clone() { + return new GraphTransferConstNodeInfo(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "node_id" field. + public const int NodeIdFieldNumber = 2; + private int nodeId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int NodeId { + get { return nodeId_; } + set { + nodeId_ = value; + } + } + + /// Field number for the "shape" field. + public const int ShapeFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_shape_codec + = pb::FieldCodec.ForInt64(26); + private readonly pbc::RepeatedField shape_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Shape { + get { return shape_; } + } + + /// Field number for the "data" field. + public const int DataFieldNumber = 4; + private pb::ByteString data_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString Data { + get { return data_; } + set { + data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "dtype" field. + public const int DtypeFieldNumber = 5; + private global::Tensorflow.DataType dtype_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.DataType Dtype { + get { return dtype_; } + set { + dtype_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GraphTransferConstNodeInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GraphTransferConstNodeInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (NodeId != other.NodeId) return false; + if(!shape_.Equals(other.shape_)) return false; + if (Data != other.Data) return false; + if (Dtype != other.Dtype) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (NodeId != 0) hash ^= NodeId.GetHashCode(); + hash ^= shape_.GetHashCode(); + if (Data.Length != 0) hash ^= Data.GetHashCode(); + if (Dtype != 0) hash ^= Dtype.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (NodeId != 0) { + output.WriteRawTag(16); + output.WriteInt32(NodeId); + } + shape_.WriteTo(output, _repeated_shape_codec); + if (Data.Length != 0) { + output.WriteRawTag(34); + output.WriteBytes(Data); + } + if (Dtype != 0) { + output.WriteRawTag(40); + output.WriteEnum((int) Dtype); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (NodeId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NodeId); + } + size += shape_.CalculateSize(_repeated_shape_codec); + if (Data.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); + } + if (Dtype != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Dtype); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GraphTransferConstNodeInfo other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.NodeId != 0) { + NodeId = other.NodeId; + } + shape_.Add(other.shape_); + if (other.Data.Length != 0) { + Data = other.Data; + } + if (other.Dtype != 0) { + Dtype = other.Dtype; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 16: { + NodeId = input.ReadInt32(); + break; + } + case 26: + case 24: { + shape_.AddEntriesFrom(input, _repeated_shape_codec); + break; + } + case 34: { + Data = input.ReadBytes(); + break; + } + case 40: { + dtype_ = (global::Tensorflow.DataType) input.ReadEnum(); + break; + } + } + } + } + + } + + public sealed partial class GraphTransferNodeInputInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphTransferNodeInputInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.GraphTransferInfoReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeInputInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeInputInfo(GraphTransferNodeInputInfo other) : this() { + nodeId_ = other.nodeId_; + nodeInput_ = other.nodeInput_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeInputInfo Clone() { + return new GraphTransferNodeInputInfo(this); + } + + /// Field number for the "node_id" field. + public const int NodeIdFieldNumber = 1; + private int nodeId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int NodeId { + get { return nodeId_; } + set { + nodeId_ = value; + } + } + + /// Field number for the "node_input" field. + public const int NodeInputFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_nodeInput_codec + = pb::FieldCodec.ForMessage(18, global::Tensorflow.GraphTransferNodeInput.Parser); + private readonly pbc::RepeatedField nodeInput_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField NodeInput { + get { return nodeInput_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GraphTransferNodeInputInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GraphTransferNodeInputInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NodeId != other.NodeId) return false; + if(!nodeInput_.Equals(other.nodeInput_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (NodeId != 0) hash ^= NodeId.GetHashCode(); + hash ^= nodeInput_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (NodeId != 0) { + output.WriteRawTag(8); + output.WriteInt32(NodeId); + } + nodeInput_.WriteTo(output, _repeated_nodeInput_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (NodeId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NodeId); + } + size += nodeInput_.CalculateSize(_repeated_nodeInput_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GraphTransferNodeInputInfo other) { + if (other == null) { + return; + } + if (other.NodeId != 0) { + NodeId = other.NodeId; + } + nodeInput_.Add(other.nodeInput_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NodeId = input.ReadInt32(); + break; + } + case 18: { + nodeInput_.AddEntriesFrom(input, _repeated_nodeInput_codec); + break; + } + } + } + } + + } + + public sealed partial class GraphTransferNodeOutputInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphTransferNodeOutputInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.GraphTransferInfoReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeOutputInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeOutputInfo(GraphTransferNodeOutputInfo other) : this() { + nodeId_ = other.nodeId_; + maxByteSize_ = other.maxByteSize_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferNodeOutputInfo Clone() { + return new GraphTransferNodeOutputInfo(this); + } + + /// Field number for the "node_id" field. + public const int NodeIdFieldNumber = 1; + private int nodeId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int NodeId { + get { return nodeId_; } + set { + nodeId_ = value; + } + } + + /// Field number for the "max_byte_size" field. + public const int MaxByteSizeFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_maxByteSize_codec + = pb::FieldCodec.ForInt32(18); + private readonly pbc::RepeatedField maxByteSize_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField MaxByteSize { + get { return maxByteSize_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GraphTransferNodeOutputInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GraphTransferNodeOutputInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NodeId != other.NodeId) return false; + if(!maxByteSize_.Equals(other.maxByteSize_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (NodeId != 0) hash ^= NodeId.GetHashCode(); + hash ^= maxByteSize_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (NodeId != 0) { + output.WriteRawTag(8); + output.WriteInt32(NodeId); + } + maxByteSize_.WriteTo(output, _repeated_maxByteSize_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (NodeId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NodeId); + } + size += maxByteSize_.CalculateSize(_repeated_maxByteSize_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GraphTransferNodeOutputInfo other) { + if (other == null) { + return; + } + if (other.NodeId != 0) { + NodeId = other.NodeId; + } + maxByteSize_.Add(other.maxByteSize_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NodeId = input.ReadInt32(); + break; + } + case 18: + case 16: { + maxByteSize_.AddEntriesFrom(input, _repeated_maxByteSize_codec); + break; + } + } + } + } + + } + + public sealed partial class GraphTransferGraphInputNodeInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphTransferGraphInputNodeInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.GraphTransferInfoReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferGraphInputNodeInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferGraphInputNodeInfo(GraphTransferGraphInputNodeInfo other) : this() { + name_ = other.name_; + shape_ = other.shape_.Clone(); + dtype_ = other.dtype_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferGraphInputNodeInfo Clone() { + return new GraphTransferGraphInputNodeInfo(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "shape" field. + public const int ShapeFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_shape_codec + = pb::FieldCodec.ForInt64(18); + private readonly pbc::RepeatedField shape_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Shape { + get { return shape_; } + } + + /// Field number for the "dtype" field. + public const int DtypeFieldNumber = 3; + private global::Tensorflow.DataType dtype_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.DataType Dtype { + get { return dtype_; } + set { + dtype_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GraphTransferGraphInputNodeInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GraphTransferGraphInputNodeInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if(!shape_.Equals(other.shape_)) return false; + if (Dtype != other.Dtype) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + hash ^= shape_.GetHashCode(); + if (Dtype != 0) hash ^= Dtype.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + shape_.WriteTo(output, _repeated_shape_codec); + if (Dtype != 0) { + output.WriteRawTag(24); + output.WriteEnum((int) Dtype); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + size += shape_.CalculateSize(_repeated_shape_codec); + if (Dtype != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Dtype); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GraphTransferGraphInputNodeInfo other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + shape_.Add(other.shape_); + if (other.Dtype != 0) { + Dtype = other.Dtype; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: + case 16: { + shape_.AddEntriesFrom(input, _repeated_shape_codec); + break; + } + case 24: { + dtype_ = (global::Tensorflow.DataType) input.ReadEnum(); + break; + } + } + } + } + + } + + public sealed partial class GraphTransferGraphOutputNodeInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphTransferGraphOutputNodeInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.GraphTransferInfoReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferGraphOutputNodeInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferGraphOutputNodeInfo(GraphTransferGraphOutputNodeInfo other) : this() { + name_ = other.name_; + shape_ = other.shape_.Clone(); + dtype_ = other.dtype_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferGraphOutputNodeInfo Clone() { + return new GraphTransferGraphOutputNodeInfo(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "shape" field. + public const int ShapeFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_shape_codec + = pb::FieldCodec.ForInt64(18); + private readonly pbc::RepeatedField shape_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Shape { + get { return shape_; } + } + + /// Field number for the "dtype" field. + public const int DtypeFieldNumber = 3; + private global::Tensorflow.DataType dtype_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.DataType Dtype { + get { return dtype_; } + set { + dtype_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GraphTransferGraphOutputNodeInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GraphTransferGraphOutputNodeInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if(!shape_.Equals(other.shape_)) return false; + if (Dtype != other.Dtype) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + hash ^= shape_.GetHashCode(); + if (Dtype != 0) hash ^= Dtype.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + shape_.WriteTo(output, _repeated_shape_codec); + if (Dtype != 0) { + output.WriteRawTag(24); + output.WriteEnum((int) Dtype); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + size += shape_.CalculateSize(_repeated_shape_codec); + if (Dtype != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Dtype); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GraphTransferGraphOutputNodeInfo other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + shape_.Add(other.shape_); + if (other.Dtype != 0) { + Dtype = other.Dtype; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: + case 16: { + shape_.AddEntriesFrom(input, _repeated_shape_codec); + break; + } + case 24: { + dtype_ = (global::Tensorflow.DataType) input.ReadEnum(); + break; + } + } + } + } + + } + + /// + /// Protocol buffer representing a handle to a tensorflow resource. Handles are + /// not valid across executions, but can be serialized back and forth from within + /// a single run. + /// + public sealed partial class GraphTransferInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphTransferInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.GraphTransferInfoReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferInfo(GraphTransferInfo other) : this() { + nodeInfo_ = other.nodeInfo_.Clone(); + constNodeInfo_ = other.constNodeInfo_.Clone(); + nodeInputInfo_ = other.nodeInputInfo_.Clone(); + nodeOutputInfo_ = other.nodeOutputInfo_.Clone(); + graphInputNodeInfo_ = other.graphInputNodeInfo_.Clone(); + graphOutputNodeInfo_ = other.graphOutputNodeInfo_.Clone(); + destination_ = other.destination_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GraphTransferInfo Clone() { + return new GraphTransferInfo(this); + } + + /// Field number for the "node_info" field. + public const int NodeInfoFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_nodeInfo_codec + = pb::FieldCodec.ForMessage(10, global::Tensorflow.GraphTransferNodeInfo.Parser); + private readonly pbc::RepeatedField nodeInfo_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField NodeInfo { + get { return nodeInfo_; } + } + + /// Field number for the "const_node_info" field. + public const int ConstNodeInfoFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_constNodeInfo_codec + = pb::FieldCodec.ForMessage(18, global::Tensorflow.GraphTransferConstNodeInfo.Parser); + private readonly pbc::RepeatedField constNodeInfo_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ConstNodeInfo { + get { return constNodeInfo_; } + } + + /// Field number for the "node_input_info" field. + public const int NodeInputInfoFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_nodeInputInfo_codec + = pb::FieldCodec.ForMessage(26, global::Tensorflow.GraphTransferNodeInputInfo.Parser); + private readonly pbc::RepeatedField nodeInputInfo_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField NodeInputInfo { + get { return nodeInputInfo_; } + } + + /// Field number for the "node_output_info" field. + public const int NodeOutputInfoFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_nodeOutputInfo_codec + = pb::FieldCodec.ForMessage(34, global::Tensorflow.GraphTransferNodeOutputInfo.Parser); + private readonly pbc::RepeatedField nodeOutputInfo_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField NodeOutputInfo { + get { return nodeOutputInfo_; } + } + + /// Field number for the "graph_input_node_info" field. + public const int GraphInputNodeInfoFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_graphInputNodeInfo_codec + = pb::FieldCodec.ForMessage(42, global::Tensorflow.GraphTransferGraphInputNodeInfo.Parser); + private readonly pbc::RepeatedField graphInputNodeInfo_ = new pbc::RepeatedField(); + /// + /// Input Node parameters of transferred graph + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField GraphInputNodeInfo { + get { return graphInputNodeInfo_; } + } + + /// Field number for the "graph_output_node_info" field. + public const int GraphOutputNodeInfoFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_graphOutputNodeInfo_codec + = pb::FieldCodec.ForMessage(50, global::Tensorflow.GraphTransferGraphOutputNodeInfo.Parser); + private readonly pbc::RepeatedField graphOutputNodeInfo_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField GraphOutputNodeInfo { + get { return graphOutputNodeInfo_; } + } + + /// Field number for the "destination" field. + public const int DestinationFieldNumber = 7; + private global::Tensorflow.GraphTransferInfo.Types.Destination destination_ = 0; + /// + /// Destination of graph transfer + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.GraphTransferInfo.Types.Destination Destination { + get { return destination_; } + set { + destination_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GraphTransferInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GraphTransferInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!nodeInfo_.Equals(other.nodeInfo_)) return false; + if(!constNodeInfo_.Equals(other.constNodeInfo_)) return false; + if(!nodeInputInfo_.Equals(other.nodeInputInfo_)) return false; + if(!nodeOutputInfo_.Equals(other.nodeOutputInfo_)) return false; + if(!graphInputNodeInfo_.Equals(other.graphInputNodeInfo_)) return false; + if(!graphOutputNodeInfo_.Equals(other.graphOutputNodeInfo_)) return false; + if (Destination != other.Destination) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= nodeInfo_.GetHashCode(); + hash ^= constNodeInfo_.GetHashCode(); + hash ^= nodeInputInfo_.GetHashCode(); + hash ^= nodeOutputInfo_.GetHashCode(); + hash ^= graphInputNodeInfo_.GetHashCode(); + hash ^= graphOutputNodeInfo_.GetHashCode(); + if (Destination != 0) hash ^= Destination.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + nodeInfo_.WriteTo(output, _repeated_nodeInfo_codec); + constNodeInfo_.WriteTo(output, _repeated_constNodeInfo_codec); + nodeInputInfo_.WriteTo(output, _repeated_nodeInputInfo_codec); + nodeOutputInfo_.WriteTo(output, _repeated_nodeOutputInfo_codec); + graphInputNodeInfo_.WriteTo(output, _repeated_graphInputNodeInfo_codec); + graphOutputNodeInfo_.WriteTo(output, _repeated_graphOutputNodeInfo_codec); + if (Destination != 0) { + output.WriteRawTag(56); + output.WriteEnum((int) Destination); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += nodeInfo_.CalculateSize(_repeated_nodeInfo_codec); + size += constNodeInfo_.CalculateSize(_repeated_constNodeInfo_codec); + size += nodeInputInfo_.CalculateSize(_repeated_nodeInputInfo_codec); + size += nodeOutputInfo_.CalculateSize(_repeated_nodeOutputInfo_codec); + size += graphInputNodeInfo_.CalculateSize(_repeated_graphInputNodeInfo_codec); + size += graphOutputNodeInfo_.CalculateSize(_repeated_graphOutputNodeInfo_codec); + if (Destination != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Destination); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GraphTransferInfo other) { + if (other == null) { + return; + } + nodeInfo_.Add(other.nodeInfo_); + constNodeInfo_.Add(other.constNodeInfo_); + nodeInputInfo_.Add(other.nodeInputInfo_); + nodeOutputInfo_.Add(other.nodeOutputInfo_); + graphInputNodeInfo_.Add(other.graphInputNodeInfo_); + graphOutputNodeInfo_.Add(other.graphOutputNodeInfo_); + if (other.Destination != 0) { + Destination = other.Destination; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + nodeInfo_.AddEntriesFrom(input, _repeated_nodeInfo_codec); + break; + } + case 18: { + constNodeInfo_.AddEntriesFrom(input, _repeated_constNodeInfo_codec); + break; + } + case 26: { + nodeInputInfo_.AddEntriesFrom(input, _repeated_nodeInputInfo_codec); + break; + } + case 34: { + nodeOutputInfo_.AddEntriesFrom(input, _repeated_nodeOutputInfo_codec); + break; + } + case 42: { + graphInputNodeInfo_.AddEntriesFrom(input, _repeated_graphInputNodeInfo_codec); + break; + } + case 50: { + graphOutputNodeInfo_.AddEntriesFrom(input, _repeated_graphOutputNodeInfo_codec); + break; + } + case 56: { + destination_ = (global::Tensorflow.GraphTransferInfo.Types.Destination) input.ReadEnum(); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the GraphTransferInfo message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + public enum Destination { + [pbr::OriginalName("NOP")] Nop = 0, + [pbr::OriginalName("HEXAGON")] Hexagon = 1, + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/Iterator.cs b/src/TensorFlowNET.Core/Protobuf/Iterator.cs new file mode 100644 index 00000000..bc06fae1 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/Iterator.cs @@ -0,0 +1,205 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/iterator.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/iterator.proto + public static partial class IteratorReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/iterator.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static IteratorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2l0ZXJhdG9yLnByb3RvEgp0", + "ZW5zb3JmbG93IjYKFUl0ZXJhdG9yU3RhdGVNZXRhZGF0YRIPCgd2ZXJzaW9u", + "GAEgASgJEgwKBGtleXMYAiADKAlCaQoTb3JnLnRlbnNvcmZsb3cudXRpbEIO", + "SXRlcmF0b3JQcm90b3NQAVo9Z2l0aHViLmNvbS90ZW5zb3JmbG93L3RlbnNv", + "cmZsb3cvdGVuc29yZmxvdy9nby9jb3JlL2ZyYW1ld29ya/gBAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.IteratorStateMetadata), global::Tensorflow.IteratorStateMetadata.Parser, new[]{ "Version", "Keys" }, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// Protocol buffer representing the metadata for an iterator's state stored + /// as a Variant tensor. + /// + public sealed partial class IteratorStateMetadata : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IteratorStateMetadata()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.IteratorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IteratorStateMetadata() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IteratorStateMetadata(IteratorStateMetadata other) : this() { + version_ = other.version_; + keys_ = other.keys_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public IteratorStateMetadata Clone() { + return new IteratorStateMetadata(this); + } + + /// Field number for the "version" field. + public const int VersionFieldNumber = 1; + private string version_ = ""; + /// + /// A user-specified version string. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Version { + get { return version_; } + set { + version_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "keys" field. + public const int KeysFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_keys_codec + = pb::FieldCodec.ForString(18); + private readonly pbc::RepeatedField keys_ = new pbc::RepeatedField(); + /// + /// Keys for tensors in the VariantTensorDataProto. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Keys { + get { return keys_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as IteratorStateMetadata); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(IteratorStateMetadata other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Version != other.Version) return false; + if(!keys_.Equals(other.keys_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Version.Length != 0) hash ^= Version.GetHashCode(); + hash ^= keys_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Version.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Version); + } + keys_.WriteTo(output, _repeated_keys_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Version.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Version); + } + size += keys_.CalculateSize(_repeated_keys_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(IteratorStateMetadata other) { + if (other == null) { + return; + } + if (other.Version.Length != 0) { + Version = other.Version; + } + keys_.Add(other.keys_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Version = input.ReadString(); + break; + } + case 18: { + keys_.AddEntriesFrom(input, _repeated_keys_codec); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/KernelDef.cs b/src/TensorFlowNET.Core/Protobuf/KernelDef.cs new file mode 100644 index 00000000..b3c3e513 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/KernelDef.cs @@ -0,0 +1,628 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/kernel_def.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/kernel_def.proto + public static partial class KernelDefReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/kernel_def.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static KernelDefReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2tlcm5lbF9kZWYucHJvdG8S", + "CnRlbnNvcmZsb3caKnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvYXR0cl92", + "YWx1ZS5wcm90byLvAQoJS2VybmVsRGVmEgoKAm9wGAEgASgJEhMKC2Rldmlj", + "ZV90eXBlGAIgASgJEjgKCmNvbnN0cmFpbnQYAyADKAsyJC50ZW5zb3JmbG93", + "Lktlcm5lbERlZi5BdHRyQ29uc3RyYWludBIXCg9ob3N0X21lbW9yeV9hcmcY", + "BCADKAkSDQoFbGFiZWwYBSABKAkSEAoIcHJpb3JpdHkYBiABKAUaTQoOQXR0", + "ckNvbnN0cmFpbnQSDAoEbmFtZRgBIAEoCRItCg5hbGxvd2VkX3ZhbHVlcxgC", + "IAEoCzIVLnRlbnNvcmZsb3cuQXR0clZhbHVlIjMKCktlcm5lbExpc3QSJQoG", + "a2VybmVsGAEgAygLMhUudGVuc29yZmxvdy5LZXJuZWxEZWZCbwoYb3JnLnRl", + "bnNvcmZsb3cuZnJhbWV3b3JrQg9LZXJuZWxEZWZQcm90b3NQAVo9Z2l0aHVi", + "LmNvbS90ZW5zb3JmbG93L3RlbnNvcmZsb3cvdGVuc29yZmxvdy9nby9jb3Jl", + "L2ZyYW1ld29ya/gBAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tensorflow.AttrValueReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.KernelDef), global::Tensorflow.KernelDef.Parser, new[]{ "Op", "DeviceType", "Constraint", "HostMemoryArg", "Label", "Priority" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.KernelDef.Types.AttrConstraint), global::Tensorflow.KernelDef.Types.AttrConstraint.Parser, new[]{ "Name", "AllowedValues" }, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.KernelList), global::Tensorflow.KernelList.Parser, new[]{ "Kernel" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class KernelDef : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KernelDef()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.KernelDefReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KernelDef() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KernelDef(KernelDef other) : this() { + op_ = other.op_; + deviceType_ = other.deviceType_; + constraint_ = other.constraint_.Clone(); + hostMemoryArg_ = other.hostMemoryArg_.Clone(); + label_ = other.label_; + priority_ = other.priority_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KernelDef Clone() { + return new KernelDef(this); + } + + /// Field number for the "op" field. + public const int OpFieldNumber = 1; + private string op_ = ""; + /// + /// Must match the name of an Op. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Op { + get { return op_; } + set { + op_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "device_type" field. + public const int DeviceTypeFieldNumber = 2; + private string deviceType_ = ""; + /// + /// Type of device this kernel runs on. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string DeviceType { + get { return deviceType_; } + set { + deviceType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "constraint" field. + public const int ConstraintFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_constraint_codec + = pb::FieldCodec.ForMessage(26, global::Tensorflow.KernelDef.Types.AttrConstraint.Parser); + private readonly pbc::RepeatedField constraint_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Constraint { + get { return constraint_; } + } + + /// Field number for the "host_memory_arg" field. + public const int HostMemoryArgFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_hostMemoryArg_codec + = pb::FieldCodec.ForString(34); + private readonly pbc::RepeatedField hostMemoryArg_ = new pbc::RepeatedField(); + /// + /// Names of the Op's input_/output_args that reside in host memory + /// instead of device memory. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField HostMemoryArg { + get { return hostMemoryArg_; } + } + + /// Field number for the "label" field. + public const int LabelFieldNumber = 5; + private string label_ = ""; + /// + /// This allows experimental kernels to be registered for an op that + /// won't be used unless the user specifies a "_kernel" attr with + /// value matching this. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Label { + get { return label_; } + set { + label_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "priority" field. + public const int PriorityFieldNumber = 6; + private int priority_; + /// + /// Prioritization of kernel amongst different devices. By default we assume + /// priority is 0. The higher the priority the better. By default (i.e. if + /// this is not set), we prefer GPU kernels over CPU. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Priority { + get { return priority_; } + set { + priority_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KernelDef); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KernelDef other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Op != other.Op) return false; + if (DeviceType != other.DeviceType) return false; + if(!constraint_.Equals(other.constraint_)) return false; + if(!hostMemoryArg_.Equals(other.hostMemoryArg_)) return false; + if (Label != other.Label) return false; + if (Priority != other.Priority) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Op.Length != 0) hash ^= Op.GetHashCode(); + if (DeviceType.Length != 0) hash ^= DeviceType.GetHashCode(); + hash ^= constraint_.GetHashCode(); + hash ^= hostMemoryArg_.GetHashCode(); + if (Label.Length != 0) hash ^= Label.GetHashCode(); + if (Priority != 0) hash ^= Priority.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Op.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Op); + } + if (DeviceType.Length != 0) { + output.WriteRawTag(18); + output.WriteString(DeviceType); + } + constraint_.WriteTo(output, _repeated_constraint_codec); + hostMemoryArg_.WriteTo(output, _repeated_hostMemoryArg_codec); + if (Label.Length != 0) { + output.WriteRawTag(42); + output.WriteString(Label); + } + if (Priority != 0) { + output.WriteRawTag(48); + output.WriteInt32(Priority); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Op.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Op); + } + if (DeviceType.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DeviceType); + } + size += constraint_.CalculateSize(_repeated_constraint_codec); + size += hostMemoryArg_.CalculateSize(_repeated_hostMemoryArg_codec); + if (Label.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Label); + } + if (Priority != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Priority); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KernelDef other) { + if (other == null) { + return; + } + if (other.Op.Length != 0) { + Op = other.Op; + } + if (other.DeviceType.Length != 0) { + DeviceType = other.DeviceType; + } + constraint_.Add(other.constraint_); + hostMemoryArg_.Add(other.hostMemoryArg_); + if (other.Label.Length != 0) { + Label = other.Label; + } + if (other.Priority != 0) { + Priority = other.Priority; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Op = input.ReadString(); + break; + } + case 18: { + DeviceType = input.ReadString(); + break; + } + case 26: { + constraint_.AddEntriesFrom(input, _repeated_constraint_codec); + break; + } + case 34: { + hostMemoryArg_.AddEntriesFrom(input, _repeated_hostMemoryArg_codec); + break; + } + case 42: { + Label = input.ReadString(); + break; + } + case 48: { + Priority = input.ReadInt32(); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the KernelDef message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + public sealed partial class AttrConstraint : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AttrConstraint()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.KernelDef.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AttrConstraint() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AttrConstraint(AttrConstraint other) : this() { + name_ = other.name_; + allowedValues_ = other.allowedValues_ != null ? other.allowedValues_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AttrConstraint Clone() { + return new AttrConstraint(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + /// + /// Name of an attr from the Op. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "allowed_values" field. + public const int AllowedValuesFieldNumber = 2; + private global::Tensorflow.AttrValue allowedValues_; + /// + /// A list of values that this kernel supports for this attr. + /// Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.AttrValue AllowedValues { + get { return allowedValues_; } + set { + allowedValues_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AttrConstraint); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AttrConstraint other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (!object.Equals(AllowedValues, other.AllowedValues)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (allowedValues_ != null) hash ^= AllowedValues.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (allowedValues_ != null) { + output.WriteRawTag(18); + output.WriteMessage(AllowedValues); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (allowedValues_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(AllowedValues); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AttrConstraint other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.allowedValues_ != null) { + if (allowedValues_ == null) { + allowedValues_ = new global::Tensorflow.AttrValue(); + } + AllowedValues.MergeFrom(other.AllowedValues); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + if (allowedValues_ == null) { + allowedValues_ = new global::Tensorflow.AttrValue(); + } + input.ReadMessage(allowedValues_); + break; + } + } + } + } + + } + + } + #endregion + + } + + /// + /// A collection of KernelDefs + /// + public sealed partial class KernelList : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KernelList()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.KernelDefReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KernelList() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KernelList(KernelList other) : this() { + kernel_ = other.kernel_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public KernelList Clone() { + return new KernelList(this); + } + + /// Field number for the "kernel" field. + public const int KernelFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_kernel_codec + = pb::FieldCodec.ForMessage(10, global::Tensorflow.KernelDef.Parser); + private readonly pbc::RepeatedField kernel_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Kernel { + get { return kernel_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as KernelList); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(KernelList other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!kernel_.Equals(other.kernel_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= kernel_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + kernel_.WriteTo(output, _repeated_kernel_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += kernel_.CalculateSize(_repeated_kernel_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(KernelList other) { + if (other == null) { + return; + } + kernel_.Add(other.kernel_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + kernel_.AddEntriesFrom(input, _repeated_kernel_codec); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/LogMemory.cs b/src/TensorFlowNET.Core/Protobuf/LogMemory.cs new file mode 100644 index 00000000..e2653bfc --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/LogMemory.cs @@ -0,0 +1,1372 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/log_memory.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/log_memory.proto + public static partial class LogMemoryReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/log_memory.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static LogMemoryReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2xvZ19tZW1vcnkucHJvdG8S", + "CnRlbnNvcmZsb3caMnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvdGVuc29y", + "X2Rlc2NyaXB0aW9uLnByb3RvIjAKDU1lbW9yeUxvZ1N0ZXASDwoHc3RlcF9p", + "ZBgBIAEoAxIOCgZoYW5kbGUYAiABKAkicAoZTWVtb3J5TG9nVGVuc29yQWxs", + "b2NhdGlvbhIPCgdzdGVwX2lkGAEgASgDEhMKC2tlcm5lbF9uYW1lGAIgASgJ", + "Ei0KBnRlbnNvchgDIAEoCzIdLnRlbnNvcmZsb3cuVGVuc29yRGVzY3JpcHRp", + "b24iTAobTWVtb3J5TG9nVGVuc29yRGVhbGxvY2F0aW9uEhUKDWFsbG9jYXRp", + "b25faWQYASABKAMSFgoOYWxsb2NhdG9yX25hbWUYAiABKAkiewoVTWVtb3J5", + "TG9nVGVuc29yT3V0cHV0Eg8KB3N0ZXBfaWQYASABKAMSEwoLa2VybmVsX25h", + "bWUYAiABKAkSDQoFaW5kZXgYAyABKAUSLQoGdGVuc29yGAQgASgLMh0udGVu", + "c29yZmxvdy5UZW5zb3JEZXNjcmlwdGlvbiKLAQoWTWVtb3J5TG9nUmF3QWxs", + "b2NhdGlvbhIPCgdzdGVwX2lkGAEgASgDEhEKCW9wZXJhdGlvbhgCIAEoCRIR", + "CgludW1fYnl0ZXMYAyABKAMSCwoDcHRyGAQgASgEEhUKDWFsbG9jYXRpb25f", + "aWQYBSABKAMSFgoOYWxsb2NhdG9yX25hbWUYBiABKAkifwoYTWVtb3J5TG9n", + "UmF3RGVhbGxvY2F0aW9uEg8KB3N0ZXBfaWQYASABKAMSEQoJb3BlcmF0aW9u", + "GAIgASgJEhUKDWFsbG9jYXRpb25faWQYAyABKAMSFgoOYWxsb2NhdG9yX25h", + "bWUYBCABKAkSEAoIZGVmZXJyZWQYBSABKAhCbwoYb3JnLnRlbnNvcmZsb3cu", + "ZnJhbWV3b3JrQg9Mb2dNZW1vcnlQcm90b3NQAVo9Z2l0aHViLmNvbS90ZW5z", + "b3JmbG93L3RlbnNvcmZsb3cvdGVuc29yZmxvdy9nby9jb3JlL2ZyYW1ld29y", + "a/gBAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tensorflow.TensorDescriptionReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.MemoryLogStep), global::Tensorflow.MemoryLogStep.Parser, new[]{ "StepId", "Handle" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.MemoryLogTensorAllocation), global::Tensorflow.MemoryLogTensorAllocation.Parser, new[]{ "StepId", "KernelName", "Tensor" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.MemoryLogTensorDeallocation), global::Tensorflow.MemoryLogTensorDeallocation.Parser, new[]{ "AllocationId", "AllocatorName" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.MemoryLogTensorOutput), global::Tensorflow.MemoryLogTensorOutput.Parser, new[]{ "StepId", "KernelName", "Index", "Tensor" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.MemoryLogRawAllocation), global::Tensorflow.MemoryLogRawAllocation.Parser, new[]{ "StepId", "Operation", "NumBytes", "Ptr", "AllocationId", "AllocatorName" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.MemoryLogRawDeallocation), global::Tensorflow.MemoryLogRawDeallocation.Parser, new[]{ "StepId", "Operation", "AllocationId", "AllocatorName", "Deferred" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class MemoryLogStep : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MemoryLogStep()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.LogMemoryReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogStep() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogStep(MemoryLogStep other) : this() { + stepId_ = other.stepId_; + handle_ = other.handle_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogStep Clone() { + return new MemoryLogStep(this); + } + + /// Field number for the "step_id" field. + public const int StepIdFieldNumber = 1; + private long stepId_; + /// + /// Process-unique step id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long StepId { + get { return stepId_; } + set { + stepId_ = value; + } + } + + /// Field number for the "handle" field. + public const int HandleFieldNumber = 2; + private string handle_ = ""; + /// + /// Handle describing the feeds and fetches of the step. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Handle { + get { return handle_; } + set { + handle_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MemoryLogStep); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MemoryLogStep other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (StepId != other.StepId) return false; + if (Handle != other.Handle) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (StepId != 0L) hash ^= StepId.GetHashCode(); + if (Handle.Length != 0) hash ^= Handle.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (StepId != 0L) { + output.WriteRawTag(8); + output.WriteInt64(StepId); + } + if (Handle.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Handle); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (StepId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(StepId); + } + if (Handle.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Handle); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MemoryLogStep other) { + if (other == null) { + return; + } + if (other.StepId != 0L) { + StepId = other.StepId; + } + if (other.Handle.Length != 0) { + Handle = other.Handle; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + StepId = input.ReadInt64(); + break; + } + case 18: { + Handle = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class MemoryLogTensorAllocation : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MemoryLogTensorAllocation()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.LogMemoryReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogTensorAllocation() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogTensorAllocation(MemoryLogTensorAllocation other) : this() { + stepId_ = other.stepId_; + kernelName_ = other.kernelName_; + tensor_ = other.tensor_ != null ? other.tensor_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogTensorAllocation Clone() { + return new MemoryLogTensorAllocation(this); + } + + /// Field number for the "step_id" field. + public const int StepIdFieldNumber = 1; + private long stepId_; + /// + /// Process-unique step id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long StepId { + get { return stepId_; } + set { + stepId_ = value; + } + } + + /// Field number for the "kernel_name" field. + public const int KernelNameFieldNumber = 2; + private string kernelName_ = ""; + /// + /// Name of the kernel making the allocation as set in GraphDef, + /// e.g., "affine2/weights/Assign". + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string KernelName { + get { return kernelName_; } + set { + kernelName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "tensor" field. + public const int TensorFieldNumber = 3; + private global::Tensorflow.TensorDescription tensor_; + /// + /// Allocated tensor details. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.TensorDescription Tensor { + get { return tensor_; } + set { + tensor_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MemoryLogTensorAllocation); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MemoryLogTensorAllocation other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (StepId != other.StepId) return false; + if (KernelName != other.KernelName) return false; + if (!object.Equals(Tensor, other.Tensor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (StepId != 0L) hash ^= StepId.GetHashCode(); + if (KernelName.Length != 0) hash ^= KernelName.GetHashCode(); + if (tensor_ != null) hash ^= Tensor.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (StepId != 0L) { + output.WriteRawTag(8); + output.WriteInt64(StepId); + } + if (KernelName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(KernelName); + } + if (tensor_ != null) { + output.WriteRawTag(26); + output.WriteMessage(Tensor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (StepId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(StepId); + } + if (KernelName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(KernelName); + } + if (tensor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Tensor); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MemoryLogTensorAllocation other) { + if (other == null) { + return; + } + if (other.StepId != 0L) { + StepId = other.StepId; + } + if (other.KernelName.Length != 0) { + KernelName = other.KernelName; + } + if (other.tensor_ != null) { + if (tensor_ == null) { + tensor_ = new global::Tensorflow.TensorDescription(); + } + Tensor.MergeFrom(other.Tensor); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + StepId = input.ReadInt64(); + break; + } + case 18: { + KernelName = input.ReadString(); + break; + } + case 26: { + if (tensor_ == null) { + tensor_ = new global::Tensorflow.TensorDescription(); + } + input.ReadMessage(tensor_); + break; + } + } + } + } + + } + + public sealed partial class MemoryLogTensorDeallocation : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MemoryLogTensorDeallocation()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.LogMemoryReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogTensorDeallocation() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogTensorDeallocation(MemoryLogTensorDeallocation other) : this() { + allocationId_ = other.allocationId_; + allocatorName_ = other.allocatorName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogTensorDeallocation Clone() { + return new MemoryLogTensorDeallocation(this); + } + + /// Field number for the "allocation_id" field. + public const int AllocationIdFieldNumber = 1; + private long allocationId_; + /// + /// Id of the tensor buffer being deallocated, used to match to a + /// corresponding allocation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllocationId { + get { return allocationId_; } + set { + allocationId_ = value; + } + } + + /// Field number for the "allocator_name" field. + public const int AllocatorNameFieldNumber = 2; + private string allocatorName_ = ""; + /// + /// Name of the allocator used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string AllocatorName { + get { return allocatorName_; } + set { + allocatorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MemoryLogTensorDeallocation); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MemoryLogTensorDeallocation other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (AllocationId != other.AllocationId) return false; + if (AllocatorName != other.AllocatorName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (AllocationId != 0L) hash ^= AllocationId.GetHashCode(); + if (AllocatorName.Length != 0) hash ^= AllocatorName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (AllocationId != 0L) { + output.WriteRawTag(8); + output.WriteInt64(AllocationId); + } + if (AllocatorName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(AllocatorName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (AllocationId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocationId); + } + if (AllocatorName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(AllocatorName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MemoryLogTensorDeallocation other) { + if (other == null) { + return; + } + if (other.AllocationId != 0L) { + AllocationId = other.AllocationId; + } + if (other.AllocatorName.Length != 0) { + AllocatorName = other.AllocatorName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + AllocationId = input.ReadInt64(); + break; + } + case 18: { + AllocatorName = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class MemoryLogTensorOutput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MemoryLogTensorOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.LogMemoryReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogTensorOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogTensorOutput(MemoryLogTensorOutput other) : this() { + stepId_ = other.stepId_; + kernelName_ = other.kernelName_; + index_ = other.index_; + tensor_ = other.tensor_ != null ? other.tensor_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogTensorOutput Clone() { + return new MemoryLogTensorOutput(this); + } + + /// Field number for the "step_id" field. + public const int StepIdFieldNumber = 1; + private long stepId_; + /// + /// Process-unique step id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long StepId { + get { return stepId_; } + set { + stepId_ = value; + } + } + + /// Field number for the "kernel_name" field. + public const int KernelNameFieldNumber = 2; + private string kernelName_ = ""; + /// + /// Name of the kernel producing an output as set in GraphDef, e.g., + /// "affine2/weights/Assign". + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string KernelName { + get { return kernelName_; } + set { + kernelName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "index" field. + public const int IndexFieldNumber = 3; + private int index_; + /// + /// Index of the output being set. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Index { + get { return index_; } + set { + index_ = value; + } + } + + /// Field number for the "tensor" field. + public const int TensorFieldNumber = 4; + private global::Tensorflow.TensorDescription tensor_; + /// + /// Output tensor details. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.TensorDescription Tensor { + get { return tensor_; } + set { + tensor_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MemoryLogTensorOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MemoryLogTensorOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (StepId != other.StepId) return false; + if (KernelName != other.KernelName) return false; + if (Index != other.Index) return false; + if (!object.Equals(Tensor, other.Tensor)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (StepId != 0L) hash ^= StepId.GetHashCode(); + if (KernelName.Length != 0) hash ^= KernelName.GetHashCode(); + if (Index != 0) hash ^= Index.GetHashCode(); + if (tensor_ != null) hash ^= Tensor.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (StepId != 0L) { + output.WriteRawTag(8); + output.WriteInt64(StepId); + } + if (KernelName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(KernelName); + } + if (Index != 0) { + output.WriteRawTag(24); + output.WriteInt32(Index); + } + if (tensor_ != null) { + output.WriteRawTag(34); + output.WriteMessage(Tensor); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (StepId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(StepId); + } + if (KernelName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(KernelName); + } + if (Index != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Index); + } + if (tensor_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Tensor); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MemoryLogTensorOutput other) { + if (other == null) { + return; + } + if (other.StepId != 0L) { + StepId = other.StepId; + } + if (other.KernelName.Length != 0) { + KernelName = other.KernelName; + } + if (other.Index != 0) { + Index = other.Index; + } + if (other.tensor_ != null) { + if (tensor_ == null) { + tensor_ = new global::Tensorflow.TensorDescription(); + } + Tensor.MergeFrom(other.Tensor); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + StepId = input.ReadInt64(); + break; + } + case 18: { + KernelName = input.ReadString(); + break; + } + case 24: { + Index = input.ReadInt32(); + break; + } + case 34: { + if (tensor_ == null) { + tensor_ = new global::Tensorflow.TensorDescription(); + } + input.ReadMessage(tensor_); + break; + } + } + } + } + + } + + public sealed partial class MemoryLogRawAllocation : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MemoryLogRawAllocation()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.LogMemoryReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogRawAllocation() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogRawAllocation(MemoryLogRawAllocation other) : this() { + stepId_ = other.stepId_; + operation_ = other.operation_; + numBytes_ = other.numBytes_; + ptr_ = other.ptr_; + allocationId_ = other.allocationId_; + allocatorName_ = other.allocatorName_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogRawAllocation Clone() { + return new MemoryLogRawAllocation(this); + } + + /// Field number for the "step_id" field. + public const int StepIdFieldNumber = 1; + private long stepId_; + /// + /// Process-unique step id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long StepId { + get { return stepId_; } + set { + stepId_ = value; + } + } + + /// Field number for the "operation" field. + public const int OperationFieldNumber = 2; + private string operation_ = ""; + /// + /// Name of the operation making the allocation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Operation { + get { return operation_; } + set { + operation_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "num_bytes" field. + public const int NumBytesFieldNumber = 3; + private long numBytes_; + /// + /// Number of bytes in the allocation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long NumBytes { + get { return numBytes_; } + set { + numBytes_ = value; + } + } + + /// Field number for the "ptr" field. + public const int PtrFieldNumber = 4; + private ulong ptr_; + /// + /// Address of the allocation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ulong Ptr { + get { return ptr_; } + set { + ptr_ = value; + } + } + + /// Field number for the "allocation_id" field. + public const int AllocationIdFieldNumber = 5; + private long allocationId_; + /// + /// Id of the tensor buffer being allocated, used to match to a + /// corresponding deallocation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllocationId { + get { return allocationId_; } + set { + allocationId_ = value; + } + } + + /// Field number for the "allocator_name" field. + public const int AllocatorNameFieldNumber = 6; + private string allocatorName_ = ""; + /// + /// Name of the allocator used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string AllocatorName { + get { return allocatorName_; } + set { + allocatorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MemoryLogRawAllocation); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MemoryLogRawAllocation other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (StepId != other.StepId) return false; + if (Operation != other.Operation) return false; + if (NumBytes != other.NumBytes) return false; + if (Ptr != other.Ptr) return false; + if (AllocationId != other.AllocationId) return false; + if (AllocatorName != other.AllocatorName) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (StepId != 0L) hash ^= StepId.GetHashCode(); + if (Operation.Length != 0) hash ^= Operation.GetHashCode(); + if (NumBytes != 0L) hash ^= NumBytes.GetHashCode(); + if (Ptr != 0UL) hash ^= Ptr.GetHashCode(); + if (AllocationId != 0L) hash ^= AllocationId.GetHashCode(); + if (AllocatorName.Length != 0) hash ^= AllocatorName.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (StepId != 0L) { + output.WriteRawTag(8); + output.WriteInt64(StepId); + } + if (Operation.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Operation); + } + if (NumBytes != 0L) { + output.WriteRawTag(24); + output.WriteInt64(NumBytes); + } + if (Ptr != 0UL) { + output.WriteRawTag(32); + output.WriteUInt64(Ptr); + } + if (AllocationId != 0L) { + output.WriteRawTag(40); + output.WriteInt64(AllocationId); + } + if (AllocatorName.Length != 0) { + output.WriteRawTag(50); + output.WriteString(AllocatorName); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (StepId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(StepId); + } + if (Operation.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Operation); + } + if (NumBytes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(NumBytes); + } + if (Ptr != 0UL) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Ptr); + } + if (AllocationId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocationId); + } + if (AllocatorName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(AllocatorName); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MemoryLogRawAllocation other) { + if (other == null) { + return; + } + if (other.StepId != 0L) { + StepId = other.StepId; + } + if (other.Operation.Length != 0) { + Operation = other.Operation; + } + if (other.NumBytes != 0L) { + NumBytes = other.NumBytes; + } + if (other.Ptr != 0UL) { + Ptr = other.Ptr; + } + if (other.AllocationId != 0L) { + AllocationId = other.AllocationId; + } + if (other.AllocatorName.Length != 0) { + AllocatorName = other.AllocatorName; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + StepId = input.ReadInt64(); + break; + } + case 18: { + Operation = input.ReadString(); + break; + } + case 24: { + NumBytes = input.ReadInt64(); + break; + } + case 32: { + Ptr = input.ReadUInt64(); + break; + } + case 40: { + AllocationId = input.ReadInt64(); + break; + } + case 50: { + AllocatorName = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class MemoryLogRawDeallocation : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MemoryLogRawDeallocation()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.LogMemoryReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogRawDeallocation() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogRawDeallocation(MemoryLogRawDeallocation other) : this() { + stepId_ = other.stepId_; + operation_ = other.operation_; + allocationId_ = other.allocationId_; + allocatorName_ = other.allocatorName_; + deferred_ = other.deferred_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryLogRawDeallocation Clone() { + return new MemoryLogRawDeallocation(this); + } + + /// Field number for the "step_id" field. + public const int StepIdFieldNumber = 1; + private long stepId_; + /// + /// Process-unique step id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long StepId { + get { return stepId_; } + set { + stepId_ = value; + } + } + + /// Field number for the "operation" field. + public const int OperationFieldNumber = 2; + private string operation_ = ""; + /// + /// Name of the operation making the deallocation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Operation { + get { return operation_; } + set { + operation_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "allocation_id" field. + public const int AllocationIdFieldNumber = 3; + private long allocationId_; + /// + /// Id of the tensor buffer being deallocated, used to match to a + /// corresponding allocation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllocationId { + get { return allocationId_; } + set { + allocationId_ = value; + } + } + + /// Field number for the "allocator_name" field. + public const int AllocatorNameFieldNumber = 4; + private string allocatorName_ = ""; + /// + /// Name of the allocator used. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string AllocatorName { + get { return allocatorName_; } + set { + allocatorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "deferred" field. + public const int DeferredFieldNumber = 5; + private bool deferred_; + /// + /// True if the deallocation is queued and will be performed later, + /// e.g. for GPU lazy freeing of buffers. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Deferred { + get { return deferred_; } + set { + deferred_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MemoryLogRawDeallocation); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MemoryLogRawDeallocation other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (StepId != other.StepId) return false; + if (Operation != other.Operation) return false; + if (AllocationId != other.AllocationId) return false; + if (AllocatorName != other.AllocatorName) return false; + if (Deferred != other.Deferred) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (StepId != 0L) hash ^= StepId.GetHashCode(); + if (Operation.Length != 0) hash ^= Operation.GetHashCode(); + if (AllocationId != 0L) hash ^= AllocationId.GetHashCode(); + if (AllocatorName.Length != 0) hash ^= AllocatorName.GetHashCode(); + if (Deferred != false) hash ^= Deferred.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (StepId != 0L) { + output.WriteRawTag(8); + output.WriteInt64(StepId); + } + if (Operation.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Operation); + } + if (AllocationId != 0L) { + output.WriteRawTag(24); + output.WriteInt64(AllocationId); + } + if (AllocatorName.Length != 0) { + output.WriteRawTag(34); + output.WriteString(AllocatorName); + } + if (Deferred != false) { + output.WriteRawTag(40); + output.WriteBool(Deferred); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (StepId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(StepId); + } + if (Operation.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Operation); + } + if (AllocationId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocationId); + } + if (AllocatorName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(AllocatorName); + } + if (Deferred != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MemoryLogRawDeallocation other) { + if (other == null) { + return; + } + if (other.StepId != 0L) { + StepId = other.StepId; + } + if (other.Operation.Length != 0) { + Operation = other.Operation; + } + if (other.AllocationId != 0L) { + AllocationId = other.AllocationId; + } + if (other.AllocatorName.Length != 0) { + AllocatorName = other.AllocatorName; + } + if (other.Deferred != false) { + Deferred = other.Deferred; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + StepId = input.ReadInt64(); + break; + } + case 18: { + Operation = input.ReadString(); + break; + } + case 24: { + AllocationId = input.ReadInt64(); + break; + } + case 34: { + AllocatorName = input.ReadString(); + break; + } + case 40: { + Deferred = input.ReadBool(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/NodeDef.cs b/src/TensorFlowNET.Core/Protobuf/NodeDef.cs index af40fd62..044d85ac 100644 --- a/src/TensorFlowNET.Core/Protobuf/NodeDef.cs +++ b/src/TensorFlowNET.Core/Protobuf/NodeDef.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: node_def.proto +// source: tensorflow/core/framework/node_def.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Tensorflow { - /// Holder for reflection information generated from node_def.proto + /// Holder for reflection information generated from tensorflow/core/framework/node_def.proto public static partial class NodeDefReflection { #region Descriptor - /// File descriptor for node_def.proto + /// File descriptor for tensorflow/core/framework/node_def.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,18 +24,22 @@ namespace Tensorflow { static NodeDefReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cg5ub2RlX2RlZi5wcm90bxIKdGVuc29yZmxvdxoQYXR0cl92YWx1ZS5wcm90", - "byKzAQoHTm9kZURlZhIMCgRuYW1lGAEgASgJEgoKAm9wGAIgASgJEg0KBWlu", - "cHV0GAMgAygJEg4KBmRldmljZRgEIAEoCRIrCgRhdHRyGAUgAygLMh0udGVu", - "c29yZmxvdy5Ob2RlRGVmLkF0dHJFbnRyeRpCCglBdHRyRW50cnkSCwoDa2V5", - "GAEgASgJEiQKBXZhbHVlGAIgASgLMhUudGVuc29yZmxvdy5BdHRyVmFsdWU6", - "AjgBQmkKGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IJTm9kZVByb3RvUAFa", - "PWdpdGh1Yi5jb20vdGVuc29yZmxvdy90ZW5zb3JmbG93L3RlbnNvcmZsb3cv", - "Z28vY29yZS9mcmFtZXdvcmv4AQFiBnByb3RvMw==")); + "Cih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL25vZGVfZGVmLnByb3RvEgp0", + "ZW5zb3JmbG93Gip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2F0dHJfdmFs", + "dWUucHJvdG8itQIKB05vZGVEZWYSDAoEbmFtZRgBIAEoCRIKCgJvcBgCIAEo", + "CRINCgVpbnB1dBgDIAMoCRIOCgZkZXZpY2UYBCABKAkSKwoEYXR0chgFIAMo", + "CzIdLnRlbnNvcmZsb3cuTm9kZURlZi5BdHRyRW50cnkSSgoXZXhwZXJpbWVu", + "dGFsX2RlYnVnX2luZm8YBiABKAsyKS50ZW5zb3JmbG93Lk5vZGVEZWYuRXhw", + "ZXJpbWVudGFsRGVidWdJbmZvGkIKCUF0dHJFbnRyeRILCgNrZXkYASABKAkS", + "JAoFdmFsdWUYAiABKAsyFS50ZW5zb3JmbG93LkF0dHJWYWx1ZToCOAEaNAoV", + "RXhwZXJpbWVudGFsRGVidWdJbmZvEhsKE29yaWdpbmFsX25vZGVfbmFtZXMY", + "ASADKAlCaQoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQglOb2RlUHJvdG9Q", + "AVo9Z2l0aHViLmNvbS90ZW5zb3JmbG93L3RlbnNvcmZsb3cvdGVuc29yZmxv", + "dy9nby9jb3JlL2ZyYW1ld29ya/gBAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tensorflow.AttrValueReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.NodeDef), global::Tensorflow.NodeDef.Parser, new[]{ "Name", "Op", "Input", "Device", "Attr" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }) + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.NodeDef), global::Tensorflow.NodeDef.Parser, new[]{ "Name", "Op", "Input", "Device", "Attr", "ExperimentalDebugInfo" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.NodeDef.Types.ExperimentalDebugInfo), global::Tensorflow.NodeDef.Types.ExperimentalDebugInfo.Parser, new[]{ "OriginalNodeNames" }, null, null, null)}) })); } #endregion @@ -72,6 +76,7 @@ namespace Tensorflow { input_ = other.input_.Clone(); device_ = other.device_; attr_ = other.attr_.Clone(); + experimentalDebugInfo_ = other.experimentalDebugInfo_ != null ? other.experimentalDebugInfo_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -185,6 +190,20 @@ namespace Tensorflow { get { return attr_; } } + /// Field number for the "experimental_debug_info" field. + public const int ExperimentalDebugInfoFieldNumber = 6; + private global::Tensorflow.NodeDef.Types.ExperimentalDebugInfo experimentalDebugInfo_; + /// + /// This stores debug information associated with the node. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.NodeDef.Types.ExperimentalDebugInfo ExperimentalDebugInfo { + get { return experimentalDebugInfo_; } + set { + experimentalDebugInfo_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as NodeDef); @@ -203,6 +222,7 @@ namespace Tensorflow { if(!input_.Equals(other.input_)) return false; if (Device != other.Device) return false; if (!Attr.Equals(other.Attr)) return false; + if (!object.Equals(ExperimentalDebugInfo, other.ExperimentalDebugInfo)) return false; return Equals(_unknownFields, other._unknownFields); } @@ -214,6 +234,7 @@ namespace Tensorflow { hash ^= input_.GetHashCode(); if (Device.Length != 0) hash ^= Device.GetHashCode(); hash ^= Attr.GetHashCode(); + if (experimentalDebugInfo_ != null) hash ^= ExperimentalDebugInfo.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -241,6 +262,10 @@ namespace Tensorflow { output.WriteString(Device); } attr_.WriteTo(output, _map_attr_codec); + if (experimentalDebugInfo_ != null) { + output.WriteRawTag(50); + output.WriteMessage(ExperimentalDebugInfo); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -260,6 +285,9 @@ namespace Tensorflow { size += 1 + pb::CodedOutputStream.ComputeStringSize(Device); } size += attr_.CalculateSize(_map_attr_codec); + if (experimentalDebugInfo_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExperimentalDebugInfo); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -282,6 +310,12 @@ namespace Tensorflow { Device = other.Device; } attr_.Add(other.attr_); + if (other.experimentalDebugInfo_ != null) { + if (experimentalDebugInfo_ == null) { + experimentalDebugInfo_ = new global::Tensorflow.NodeDef.Types.ExperimentalDebugInfo(); + } + ExperimentalDebugInfo.MergeFrom(other.ExperimentalDebugInfo); + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -313,9 +347,153 @@ namespace Tensorflow { attr_.AddEntriesFrom(input, _map_attr_codec); break; } + case 50: { + if (experimentalDebugInfo_ == null) { + experimentalDebugInfo_ = new global::Tensorflow.NodeDef.Types.ExperimentalDebugInfo(); + } + input.ReadMessage(experimentalDebugInfo_); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the NodeDef message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + public sealed partial class ExperimentalDebugInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExperimentalDebugInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.NodeDef.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExperimentalDebugInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExperimentalDebugInfo(ExperimentalDebugInfo other) : this() { + originalNodeNames_ = other.originalNodeNames_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ExperimentalDebugInfo Clone() { + return new ExperimentalDebugInfo(this); + } + + /// Field number for the "original_node_names" field. + public const int OriginalNodeNamesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_originalNodeNames_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField originalNodeNames_ = new pbc::RepeatedField(); + /// + /// Opaque string inserted into error messages created by the runtime. + /// + /// This is intended to store the list of names of the nodes from the + /// original graph that this node was derived. For example if this node, say + /// C, was result of a fusion of 2 nodes A and B, then 'original_node' would + /// be {A, B}. This information can be used to map errors originating at the + /// current node to some top level source code. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField OriginalNodeNames { + get { return originalNodeNames_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ExperimentalDebugInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ExperimentalDebugInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!originalNodeNames_.Equals(other.originalNodeNames_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= originalNodeNames_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + originalNodeNames_.WriteTo(output, _repeated_originalNodeNames_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += originalNodeNames_.CalculateSize(_repeated_originalNodeNames_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ExperimentalDebugInfo other) { + if (other == null) { + return; + } + originalNodeNames_.Add(other.originalNodeNames_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + originalNodeNames_.AddEntriesFrom(input, _repeated_originalNodeNames_codec); + break; + } + } + } } + } + } + #endregion } diff --git a/src/TensorFlowNET.Core/Protobuf/OpDef.cs b/src/TensorFlowNET.Core/Protobuf/OpDef.cs index 737e97e5..eb5c933f 100644 --- a/src/TensorFlowNET.Core/Protobuf/OpDef.cs +++ b/src/TensorFlowNET.Core/Protobuf/OpDef.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: op_def.proto +// source: tensorflow/core/framework/op_def.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Tensorflow { - /// Holder for reflection information generated from op_def.proto + /// Holder for reflection information generated from tensorflow/core/framework/op_def.proto public static partial class OpDefReflection { #region Descriptor - /// File descriptor for op_def.proto + /// File descriptor for tensorflow/core/framework/op_def.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,28 +24,30 @@ namespace Tensorflow { static OpDefReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CgxvcF9kZWYucHJvdG8SCnRlbnNvcmZsb3caEGF0dHJfdmFsdWUucHJvdG8a", - "C3R5cGVzLnByb3RvIrgFCgVPcERlZhIMCgRuYW1lGAEgASgJEisKCWlucHV0", - "X2FyZxgCIAMoCzIYLnRlbnNvcmZsb3cuT3BEZWYuQXJnRGVmEiwKCm91dHB1", - "dF9hcmcYAyADKAsyGC50ZW5zb3JmbG93Lk9wRGVmLkFyZ0RlZhInCgRhdHRy", - "GAQgAygLMhkudGVuc29yZmxvdy5PcERlZi5BdHRyRGVmEi4KC2RlcHJlY2F0", - "aW9uGAggASgLMhkudGVuc29yZmxvdy5PcERlcHJlY2F0aW9uEg8KB3N1bW1h", - "cnkYBSABKAkSEwoLZGVzY3JpcHRpb24YBiABKAkSFgoOaXNfY29tbXV0YXRp", - "dmUYEiABKAgSFAoMaXNfYWdncmVnYXRlGBAgASgIEhMKC2lzX3N0YXRlZnVs", - "GBEgASgIEiIKGmFsbG93c191bmluaXRpYWxpemVkX2lucHV0GBMgASgIGp8B", - "CgZBcmdEZWYSDAoEbmFtZRgBIAEoCRITCgtkZXNjcmlwdGlvbhgCIAEoCRIi", - "CgR0eXBlGAMgASgOMhQudGVuc29yZmxvdy5EYXRhVHlwZRIRCgl0eXBlX2F0", - "dHIYBCABKAkSEwoLbnVtYmVyX2F0dHIYBSABKAkSFgoOdHlwZV9saXN0X2F0", - "dHIYBiABKAkSDgoGaXNfcmVmGBAgASgIGr0BCgdBdHRyRGVmEgwKBG5hbWUY", - "ASABKAkSDAoEdHlwZRgCIAEoCRIsCg1kZWZhdWx0X3ZhbHVlGAMgASgLMhUu", - "dGVuc29yZmxvdy5BdHRyVmFsdWUSEwoLZGVzY3JpcHRpb24YBCABKAkSEwoL", - "aGFzX21pbmltdW0YBSABKAgSDwoHbWluaW11bRgGIAEoAxItCg5hbGxvd2Vk", - "X3ZhbHVlcxgHIAEoCzIVLnRlbnNvcmZsb3cuQXR0clZhbHVlIjUKDU9wRGVw", - "cmVjYXRpb24SDwoHdmVyc2lvbhgBIAEoBRITCgtleHBsYW5hdGlvbhgCIAEo", - "CSInCgZPcExpc3QSHQoCb3AYASADKAsyES50ZW5zb3JmbG93Lk9wRGVmQmsK", - "GG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0ILT3BEZWZQcm90b3NQAVo9Z2l0", - "aHViLmNvbS90ZW5zb3JmbG93L3RlbnNvcmZsb3cvdGVuc29yZmxvdy9nby9j", - "b3JlL2ZyYW1ld29ya/gBAWIGcHJvdG8z")); + "CiZ0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL29wX2RlZi5wcm90bxIKdGVu", + "c29yZmxvdxoqdGVuc29yZmxvdy9jb3JlL2ZyYW1ld29yay9hdHRyX3ZhbHVl", + "LnByb3RvGiV0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3R5cGVzLnByb3Rv", + "IrgFCgVPcERlZhIMCgRuYW1lGAEgASgJEisKCWlucHV0X2FyZxgCIAMoCzIY", + "LnRlbnNvcmZsb3cuT3BEZWYuQXJnRGVmEiwKCm91dHB1dF9hcmcYAyADKAsy", + "GC50ZW5zb3JmbG93Lk9wRGVmLkFyZ0RlZhInCgRhdHRyGAQgAygLMhkudGVu", + "c29yZmxvdy5PcERlZi5BdHRyRGVmEi4KC2RlcHJlY2F0aW9uGAggASgLMhku", + "dGVuc29yZmxvdy5PcERlcHJlY2F0aW9uEg8KB3N1bW1hcnkYBSABKAkSEwoL", + "ZGVzY3JpcHRpb24YBiABKAkSFgoOaXNfY29tbXV0YXRpdmUYEiABKAgSFAoM", + "aXNfYWdncmVnYXRlGBAgASgIEhMKC2lzX3N0YXRlZnVsGBEgASgIEiIKGmFs", + "bG93c191bmluaXRpYWxpemVkX2lucHV0GBMgASgIGp8BCgZBcmdEZWYSDAoE", + "bmFtZRgBIAEoCRITCgtkZXNjcmlwdGlvbhgCIAEoCRIiCgR0eXBlGAMgASgO", + "MhQudGVuc29yZmxvdy5EYXRhVHlwZRIRCgl0eXBlX2F0dHIYBCABKAkSEwoL", + "bnVtYmVyX2F0dHIYBSABKAkSFgoOdHlwZV9saXN0X2F0dHIYBiABKAkSDgoG", + "aXNfcmVmGBAgASgIGr0BCgdBdHRyRGVmEgwKBG5hbWUYASABKAkSDAoEdHlw", + "ZRgCIAEoCRIsCg1kZWZhdWx0X3ZhbHVlGAMgASgLMhUudGVuc29yZmxvdy5B", + "dHRyVmFsdWUSEwoLZGVzY3JpcHRpb24YBCABKAkSEwoLaGFzX21pbmltdW0Y", + "BSABKAgSDwoHbWluaW11bRgGIAEoAxItCg5hbGxvd2VkX3ZhbHVlcxgHIAEo", + "CzIVLnRlbnNvcmZsb3cuQXR0clZhbHVlIjUKDU9wRGVwcmVjYXRpb24SDwoH", + "dmVyc2lvbhgBIAEoBRITCgtleHBsYW5hdGlvbhgCIAEoCSInCgZPcExpc3QS", + "HQoCb3AYASADKAsyES50ZW5zb3JmbG93Lk9wRGVmQmsKGG9yZy50ZW5zb3Jm", + "bG93LmZyYW1ld29ya0ILT3BEZWZQcm90b3NQAVo9Z2l0aHViLmNvbS90ZW5z", + "b3JmbG93L3RlbnNvcmZsb3cvdGVuc29yZmxvdy9nby9jb3JlL2ZyYW1ld29y", + "a/gBAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tensorflow.AttrValueReflection.Descriptor, global::Tensorflow.TypesReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { diff --git a/src/TensorFlowNET.Core/Protobuf/README.md b/src/TensorFlowNET.Core/Protobuf/README.md index 662c628e..0c8bb9ed 100644 --- a/src/TensorFlowNET.Core/Protobuf/README.md +++ b/src/TensorFlowNET.Core/Protobuf/README.md @@ -1,21 +1,37 @@ ### Download compiler from https://github.com/protocolbuffers/protobuf/releases ```shell -set SRC_DIR=D:\Projects\tensorflow -set DST_DIR=D:\Projects\TensorFlow.NET\src\TensorFlowNET.Core\Protobuf +set SRC_DIR=D:/Projects/tensorflow +set DST_DIR=D:/Projects/TensorFlow.NET/src/TensorFlowNET.Core/Protobuf cd tensorflow -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\framework\resource_handle.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\framework\tensor_shape.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\framework\types.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\framework\tensor.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\framework\attr_value.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\framework\node_def.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\framework\versions.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\framework\function.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\framework\graph.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\framework\variable.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\protobuf\saver.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\core\protobuf\meta_graph.proto -protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow\python\training\checkpoint_state.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/resource_handle.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/tensor_shape.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/types.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/tensor.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/attr_value.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/node_def.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/versions.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/function.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/graph.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/variable.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/cost_graph.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/step_stats.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/allocation_description.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/tensor_description.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/api_def.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/device_attributes.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/graph_transfer_info.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/kernel_def.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/iterator.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/log_memory.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/framework/tensor_slice.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/protobuf/saver.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/protobuf/meta_graph.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/protobuf/cluster.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/protobuf/config.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/protobuf/debug.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/core/protobuf/rewriter_config.proto +protoc -I=%SRC_DIR% --csharp_out=%DST_DIR% tensorflow/python/training/checkpoint_state.proto ``` + diff --git a/src/TensorFlowNET.Core/Protobuf/ReaderBase.cs b/src/TensorFlowNET.Core/Protobuf/ReaderBase.cs new file mode 100644 index 00000000..fc27a336 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/ReaderBase.cs @@ -0,0 +1,265 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/reader_base.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/reader_base.proto + public static partial class ReaderBaseReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/reader_base.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ReaderBaseReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cit0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3JlYWRlcl9iYXNlLnByb3Rv", + "Egp0ZW5zb3JmbG93InIKD1JlYWRlckJhc2VTdGF0ZRIUCgx3b3JrX3N0YXJ0", + "ZWQYASABKAMSFQoNd29ya19maW5pc2hlZBgCIAEoAxIcChRudW1fcmVjb3Jk", + "c19wcm9kdWNlZBgDIAEoAxIUCgxjdXJyZW50X3dvcmsYBCABKAxCcAoYb3Jn", + "LnRlbnNvcmZsb3cuZnJhbWV3b3JrQhBSZWFkZXJCYXNlUHJvdG9zUAFaPWdp", + "dGh1Yi5jb20vdGVuc29yZmxvdy90ZW5zb3JmbG93L3RlbnNvcmZsb3cvZ28v", + "Y29yZS9mcmFtZXdvcmv4AQFiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ReaderBaseState), global::Tensorflow.ReaderBaseState.Parser, new[]{ "WorkStarted", "WorkFinished", "NumRecordsProduced", "CurrentWork" }, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// For serializing and restoring the state of ReaderBase, see + /// reader_base.h for details. + /// + public sealed partial class ReaderBaseState : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReaderBaseState()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.ReaderBaseReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReaderBaseState() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReaderBaseState(ReaderBaseState other) : this() { + workStarted_ = other.workStarted_; + workFinished_ = other.workFinished_; + numRecordsProduced_ = other.numRecordsProduced_; + currentWork_ = other.currentWork_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReaderBaseState Clone() { + return new ReaderBaseState(this); + } + + /// Field number for the "work_started" field. + public const int WorkStartedFieldNumber = 1; + private long workStarted_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long WorkStarted { + get { return workStarted_; } + set { + workStarted_ = value; + } + } + + /// Field number for the "work_finished" field. + public const int WorkFinishedFieldNumber = 2; + private long workFinished_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long WorkFinished { + get { return workFinished_; } + set { + workFinished_ = value; + } + } + + /// Field number for the "num_records_produced" field. + public const int NumRecordsProducedFieldNumber = 3; + private long numRecordsProduced_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long NumRecordsProduced { + get { return numRecordsProduced_; } + set { + numRecordsProduced_ = value; + } + } + + /// Field number for the "current_work" field. + public const int CurrentWorkFieldNumber = 4; + private pb::ByteString currentWork_ = pb::ByteString.Empty; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString CurrentWork { + get { return currentWork_; } + set { + currentWork_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ReaderBaseState); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ReaderBaseState other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (WorkStarted != other.WorkStarted) return false; + if (WorkFinished != other.WorkFinished) return false; + if (NumRecordsProduced != other.NumRecordsProduced) return false; + if (CurrentWork != other.CurrentWork) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (WorkStarted != 0L) hash ^= WorkStarted.GetHashCode(); + if (WorkFinished != 0L) hash ^= WorkFinished.GetHashCode(); + if (NumRecordsProduced != 0L) hash ^= NumRecordsProduced.GetHashCode(); + if (CurrentWork.Length != 0) hash ^= CurrentWork.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (WorkStarted != 0L) { + output.WriteRawTag(8); + output.WriteInt64(WorkStarted); + } + if (WorkFinished != 0L) { + output.WriteRawTag(16); + output.WriteInt64(WorkFinished); + } + if (NumRecordsProduced != 0L) { + output.WriteRawTag(24); + output.WriteInt64(NumRecordsProduced); + } + if (CurrentWork.Length != 0) { + output.WriteRawTag(34); + output.WriteBytes(CurrentWork); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (WorkStarted != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(WorkStarted); + } + if (WorkFinished != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(WorkFinished); + } + if (NumRecordsProduced != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(NumRecordsProduced); + } + if (CurrentWork.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(CurrentWork); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ReaderBaseState other) { + if (other == null) { + return; + } + if (other.WorkStarted != 0L) { + WorkStarted = other.WorkStarted; + } + if (other.WorkFinished != 0L) { + WorkFinished = other.WorkFinished; + } + if (other.NumRecordsProduced != 0L) { + NumRecordsProduced = other.NumRecordsProduced; + } + if (other.CurrentWork.Length != 0) { + CurrentWork = other.CurrentWork; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + WorkStarted = input.ReadInt64(); + break; + } + case 16: { + WorkFinished = input.ReadInt64(); + break; + } + case 24: { + NumRecordsProduced = input.ReadInt64(); + break; + } + case 34: { + CurrentWork = input.ReadBytes(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/ResourceHandle.cs b/src/TensorFlowNET.Core/Protobuf/ResourceHandle.cs index b9c3033c..85f5bf96 100644 --- a/src/TensorFlowNET.Core/Protobuf/ResourceHandle.cs +++ b/src/TensorFlowNET.Core/Protobuf/ResourceHandle.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: resource_handle.proto +// source: tensorflow/core/framework/resource_handle.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Tensorflow { - /// Holder for reflection information generated from resource_handle.proto + /// Holder for reflection information generated from tensorflow/core/framework/resource_handle.proto public static partial class ResourceHandleReflection { #region Descriptor - /// File descriptor for resource_handle.proto + /// File descriptor for tensorflow/core/framework/resource_handle.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,13 +24,13 @@ namespace Tensorflow { static ResourceHandleReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChVyZXNvdXJjZV9oYW5kbGUucHJvdG8SCnRlbnNvcmZsb3cicgoTUmVzb3Vy", - "Y2VIYW5kbGVQcm90bxIOCgZkZXZpY2UYASABKAkSEQoJY29udGFpbmVyGAIg", - "ASgJEgwKBG5hbWUYAyABKAkSEQoJaGFzaF9jb2RlGAQgASgEEhcKD21heWJl", - "X3R5cGVfbmFtZRgFIAEoCUJuChhvcmcudGVuc29yZmxvdy5mcmFtZXdvcmtC", - "DlJlc291cmNlSGFuZGxlUAFaPWdpdGh1Yi5jb20vdGVuc29yZmxvdy90ZW5z", - "b3JmbG93L3RlbnNvcmZsb3cvZ28vY29yZS9mcmFtZXdvcmv4AQFiBnByb3Rv", - "Mw==")); + "Ci90ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3Jlc291cmNlX2hhbmRsZS5w", + "cm90bxIKdGVuc29yZmxvdyJyChNSZXNvdXJjZUhhbmRsZVByb3RvEg4KBmRl", + "dmljZRgBIAEoCRIRCgljb250YWluZXIYAiABKAkSDAoEbmFtZRgDIAEoCRIR", + "CgloYXNoX2NvZGUYBCABKAQSFwoPbWF5YmVfdHlwZV9uYW1lGAUgASgJQm4K", + "GG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IOUmVzb3VyY2VIYW5kbGVQAVo9", + "Z2l0aHViLmNvbS90ZW5zb3JmbG93L3RlbnNvcmZsb3cvdGVuc29yZmxvdy9n", + "by9jb3JlL2ZyYW1ld29ya/gBAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { diff --git a/src/TensorFlowNET.Core/Protobuf/RewriterConfig.cs b/src/TensorFlowNET.Core/Protobuf/RewriterConfig.cs new file mode 100644 index 00000000..dceb52c3 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/RewriterConfig.cs @@ -0,0 +1,1435 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/protobuf/rewriter_config.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/protobuf/rewriter_config.proto + public static partial class RewriterConfigReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/protobuf/rewriter_config.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RewriterConfigReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Ci50ZW5zb3JmbG93L2NvcmUvcHJvdG9idWYvcmV3cml0ZXJfY29uZmlnLnBy", + "b3RvEgp0ZW5zb3JmbG93Gip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2F0", + "dHJfdmFsdWUucHJvdG8iOwoTQXV0b1BhcmFsbGVsT3B0aW9ucxIOCgZlbmFi", + "bGUYASABKAgSFAoMbnVtX3JlcGxpY2FzGAIgASgFIisKFlNjb3BlZEFsbG9j", + "YXRvck9wdGlvbnMSEQoJZW5hYmxlX29wGAEgAygJIvUNCg5SZXdyaXRlckNv", + "bmZpZxI7ChBsYXlvdXRfb3B0aW1pemVyGAEgASgOMiEudGVuc29yZmxvdy5S", + "ZXdyaXRlckNvbmZpZy5Ub2dnbGUSOwoQY29uc3RhbnRfZm9sZGluZxgDIAEo", + "DjIhLnRlbnNvcmZsb3cuUmV3cml0ZXJDb25maWcuVG9nZ2xlEj0KEnNoYXBl", + "X29wdGltaXphdGlvbhgNIAEoDjIhLnRlbnNvcmZsb3cuUmV3cml0ZXJDb25m", + "aWcuVG9nZ2xlEjQKCXJlbWFwcGluZxgOIAEoDjIhLnRlbnNvcmZsb3cuUmV3", + "cml0ZXJDb25maWcuVG9nZ2xlEkIKF2FyaXRobWV0aWNfb3B0aW1pemF0aW9u", + "GAcgASgOMiEudGVuc29yZmxvdy5SZXdyaXRlckNvbmZpZy5Ub2dnbGUSQgoX", + "ZGVwZW5kZW5jeV9vcHRpbWl6YXRpb24YCCABKA4yIS50ZW5zb3JmbG93LlJl", + "d3JpdGVyQ29uZmlnLlRvZ2dsZRI8ChFsb29wX29wdGltaXphdGlvbhgJIAEo", + "DjIhLnRlbnNvcmZsb3cuUmV3cml0ZXJDb25maWcuVG9nZ2xlEkAKFWZ1bmN0", + "aW9uX29wdGltaXphdGlvbhgKIAEoDjIhLnRlbnNvcmZsb3cuUmV3cml0ZXJD", + "b25maWcuVG9nZ2xlEjkKDmRlYnVnX3N0cmlwcGVyGAsgASgOMiEudGVuc29y", + "Zmxvdy5SZXdyaXRlckNvbmZpZy5Ub2dnbGUSHQoVZGlzYWJsZV9tb2RlbF9w", + "cnVuaW5nGAIgASgIEkgKHXNjb3BlZF9hbGxvY2F0b3Jfb3B0aW1pemF0aW9u", + "GA8gASgOMiEudGVuc29yZmxvdy5SZXdyaXRlckNvbmZpZy5Ub2dnbGUSQwoY", + "cGluX3RvX2hvc3Rfb3B0aW1pemF0aW9uGBIgASgOMiEudGVuc29yZmxvdy5S", + "ZXdyaXRlckNvbmZpZy5Ub2dnbGUSHgoWZGlzYWJsZV9tZXRhX29wdGltaXpl", + "chgTIAEoCBJPChltZXRhX29wdGltaXplcl9pdGVyYXRpb25zGAwgASgOMiwu", + "dGVuc29yZmxvdy5SZXdyaXRlckNvbmZpZy5OdW1JdGVyYXRpb25zVHlwZRIX", + "Cg9taW5fZ3JhcGhfbm9kZXMYESABKAUSQgoTbWVtb3J5X29wdGltaXphdGlv", + "bhgEIAEoDjIlLnRlbnNvcmZsb3cuUmV3cml0ZXJDb25maWcuTWVtT3B0VHlw", + "ZRIvCidtZW1vcnlfb3B0aW1pemVyX3RhcmdldF9ub2RlX25hbWVfc2NvcGUY", + "BiABKAkSIQoZbWV0YV9vcHRpbWl6ZXJfdGltZW91dF9tcxgUIAEoAxI2Cg1h", + "dXRvX3BhcmFsbGVsGAUgASgLMh8udGVuc29yZmxvdy5BdXRvUGFyYWxsZWxP", + "cHRpb25zEiAKGGZhaWxfb25fb3B0aW1pemVyX2Vycm9ycxgVIAEoCBJBChVz", + "Y29wZWRfYWxsb2NhdG9yX29wdHMYECABKAsyIi50ZW5zb3JmbG93LlNjb3Bl", + "ZEFsbG9jYXRvck9wdGlvbnMSEgoKb3B0aW1pemVycxhkIAMoCRJLChFjdXN0", + "b21fb3B0aW1pemVycxjIASADKAsyLy50ZW5zb3JmbG93LlJld3JpdGVyQ29u", + "ZmlnLkN1c3RvbUdyYXBoT3B0aW1pemVyGsoBChRDdXN0b21HcmFwaE9wdGlt", + "aXplchIMCgRuYW1lGAEgASgJElgKDXBhcmFtZXRlcl9tYXAYAiADKAsyQS50", + "ZW5zb3JmbG93LlJld3JpdGVyQ29uZmlnLkN1c3RvbUdyYXBoT3B0aW1pemVy", + "LlBhcmFtZXRlck1hcEVudHJ5GkoKEVBhcmFtZXRlck1hcEVudHJ5EgsKA2tl", + "eRgBIAEoCRIkCgV2YWx1ZRgCIAEoCzIVLnRlbnNvcmZsb3cuQXR0clZhbHVl", + "OgI4ASI2CgZUb2dnbGUSCwoHREVGQVVMVBAAEgYKAk9OEAESBwoDT0ZGEAIS", + "DgoKQUdHUkVTU0lWRRADIjwKEU51bUl0ZXJhdGlvbnNUeXBlEhUKEURFRkFV", + "TFRfTlVNX0lURVJTEAASBwoDT05FEAESBwoDVFdPEAIinwEKCk1lbU9wdFR5", + "cGUSEwoPREVGQVVMVF9NRU1fT1BUEAASDgoKTk9fTUVNX09QVBABEgoKBk1B", + "TlVBTBACEhcKE1NXQVBQSU5HX0hFVVJJU1RJQ1MQBBIcChhSRUNPTVBVVEFU", + "SU9OX0hFVVJJU1RJQ1MQBRIZChVTQ0hFRFVMSU5HX0hFVVJJU1RJQ1MQBhIO", + "CgpIRVVSSVNUSUNTEANCcwoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQhRS", + "ZXdyaXRlckNvbmZpZ1Byb3Rvc1ABWjxnaXRodWIuY29tL3RlbnNvcmZsb3cv", + "dGVuc29yZmxvdy90ZW5zb3JmbG93L2dvL2NvcmUvcHJvdG9idWb4AQFiBnBy", + "b3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tensorflow.AttrValueReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AutoParallelOptions), global::Tensorflow.AutoParallelOptions.Parser, new[]{ "Enable", "NumReplicas" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.ScopedAllocatorOptions), global::Tensorflow.ScopedAllocatorOptions.Parser, new[]{ "EnableOp" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.RewriterConfig), global::Tensorflow.RewriterConfig.Parser, new[]{ "LayoutOptimizer", "ConstantFolding", "ShapeOptimization", "Remapping", "ArithmeticOptimization", "DependencyOptimization", "LoopOptimization", "FunctionOptimization", "DebugStripper", "DisableModelPruning", "ScopedAllocatorOptimization", "PinToHostOptimization", "DisableMetaOptimizer", "MetaOptimizerIterations", "MinGraphNodes", "MemoryOptimization", "MemoryOptimizerTargetNodeNameScope", "MetaOptimizerTimeoutMs", "AutoParallel", "FailOnOptimizerErrors", "ScopedAllocatorOpts", "Optimizers", "CustomOptimizers" }, null, new[]{ typeof(global::Tensorflow.RewriterConfig.Types.Toggle), typeof(global::Tensorflow.RewriterConfig.Types.NumIterationsType), typeof(global::Tensorflow.RewriterConfig.Types.MemOptType) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.RewriterConfig.Types.CustomGraphOptimizer), global::Tensorflow.RewriterConfig.Types.CustomGraphOptimizer.Parser, new[]{ "Name", "ParameterMap" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })}) + })); + } + #endregion + + } + #region Messages + public sealed partial class AutoParallelOptions : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AutoParallelOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.RewriterConfigReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AutoParallelOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AutoParallelOptions(AutoParallelOptions other) : this() { + enable_ = other.enable_; + numReplicas_ = other.numReplicas_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AutoParallelOptions Clone() { + return new AutoParallelOptions(this); + } + + /// Field number for the "enable" field. + public const int EnableFieldNumber = 1; + private bool enable_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Enable { + get { return enable_; } + set { + enable_ = value; + } + } + + /// Field number for the "num_replicas" field. + public const int NumReplicasFieldNumber = 2; + private int numReplicas_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int NumReplicas { + get { return numReplicas_; } + set { + numReplicas_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AutoParallelOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AutoParallelOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Enable != other.Enable) return false; + if (NumReplicas != other.NumReplicas) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Enable != false) hash ^= Enable.GetHashCode(); + if (NumReplicas != 0) hash ^= NumReplicas.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Enable != false) { + output.WriteRawTag(8); + output.WriteBool(Enable); + } + if (NumReplicas != 0) { + output.WriteRawTag(16); + output.WriteInt32(NumReplicas); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Enable != false) { + size += 1 + 1; + } + if (NumReplicas != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumReplicas); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AutoParallelOptions other) { + if (other == null) { + return; + } + if (other.Enable != false) { + Enable = other.Enable; + } + if (other.NumReplicas != 0) { + NumReplicas = other.NumReplicas; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Enable = input.ReadBool(); + break; + } + case 16: { + NumReplicas = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class ScopedAllocatorOptions : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScopedAllocatorOptions()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.RewriterConfigReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScopedAllocatorOptions() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScopedAllocatorOptions(ScopedAllocatorOptions other) : this() { + enableOp_ = other.enableOp_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ScopedAllocatorOptions Clone() { + return new ScopedAllocatorOptions(this); + } + + /// Field number for the "enable_op" field. + public const int EnableOpFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_enableOp_codec + = pb::FieldCodec.ForString(10); + private readonly pbc::RepeatedField enableOp_ = new pbc::RepeatedField(); + /// + /// If present, only perform optimization for these ops. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField EnableOp { + get { return enableOp_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ScopedAllocatorOptions); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ScopedAllocatorOptions other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!enableOp_.Equals(other.enableOp_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= enableOp_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + enableOp_.WriteTo(output, _repeated_enableOp_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += enableOp_.CalculateSize(_repeated_enableOp_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ScopedAllocatorOptions other) { + if (other == null) { + return; + } + enableOp_.Add(other.enableOp_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + enableOp_.AddEntriesFrom(input, _repeated_enableOp_codec); + break; + } + } + } + } + + } + + /// + /// Graph rewriting is experimental and subject to change, not covered by any + /// API stability guarantees. + /// + public sealed partial class RewriterConfig : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RewriterConfig()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.RewriterConfigReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RewriterConfig() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RewriterConfig(RewriterConfig other) : this() { + layoutOptimizer_ = other.layoutOptimizer_; + constantFolding_ = other.constantFolding_; + shapeOptimization_ = other.shapeOptimization_; + remapping_ = other.remapping_; + arithmeticOptimization_ = other.arithmeticOptimization_; + dependencyOptimization_ = other.dependencyOptimization_; + loopOptimization_ = other.loopOptimization_; + functionOptimization_ = other.functionOptimization_; + debugStripper_ = other.debugStripper_; + disableModelPruning_ = other.disableModelPruning_; + scopedAllocatorOptimization_ = other.scopedAllocatorOptimization_; + pinToHostOptimization_ = other.pinToHostOptimization_; + disableMetaOptimizer_ = other.disableMetaOptimizer_; + metaOptimizerIterations_ = other.metaOptimizerIterations_; + minGraphNodes_ = other.minGraphNodes_; + memoryOptimization_ = other.memoryOptimization_; + memoryOptimizerTargetNodeNameScope_ = other.memoryOptimizerTargetNodeNameScope_; + metaOptimizerTimeoutMs_ = other.metaOptimizerTimeoutMs_; + autoParallel_ = other.autoParallel_ != null ? other.autoParallel_.Clone() : null; + failOnOptimizerErrors_ = other.failOnOptimizerErrors_; + scopedAllocatorOpts_ = other.scopedAllocatorOpts_ != null ? other.scopedAllocatorOpts_.Clone() : null; + optimizers_ = other.optimizers_.Clone(); + customOptimizers_ = other.customOptimizers_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RewriterConfig Clone() { + return new RewriterConfig(this); + } + + /// Field number for the "layout_optimizer" field. + public const int LayoutOptimizerFieldNumber = 1; + private global::Tensorflow.RewriterConfig.Types.Toggle layoutOptimizer_ = 0; + /// + /// Optimize tensor layouts (default is ON) + /// e.g. This will try to use NCHW layout on GPU which is faster. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle LayoutOptimizer { + get { return layoutOptimizer_; } + set { + layoutOptimizer_ = value; + } + } + + /// Field number for the "constant_folding" field. + public const int ConstantFoldingFieldNumber = 3; + private global::Tensorflow.RewriterConfig.Types.Toggle constantFolding_ = 0; + /// + /// Fold constants (default is ON) + /// Statically infer the value of tensors when possible, and materialize the + /// result using constants. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle ConstantFolding { + get { return constantFolding_; } + set { + constantFolding_ = value; + } + } + + /// Field number for the "shape_optimization" field. + public const int ShapeOptimizationFieldNumber = 13; + private global::Tensorflow.RewriterConfig.Types.Toggle shapeOptimization_ = 0; + /// + /// Shape optimizations (default is ON) + /// Simplify computations made on shapes. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle ShapeOptimization { + get { return shapeOptimization_; } + set { + shapeOptimization_ = value; + } + } + + /// Field number for the "remapping" field. + public const int RemappingFieldNumber = 14; + private global::Tensorflow.RewriterConfig.Types.Toggle remapping_ = 0; + /// + /// Remapping (default is ON) + /// Remap subgraphs onto more efficient implementations. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle Remapping { + get { return remapping_; } + set { + remapping_ = value; + } + } + + /// Field number for the "arithmetic_optimization" field. + public const int ArithmeticOptimizationFieldNumber = 7; + private global::Tensorflow.RewriterConfig.Types.Toggle arithmeticOptimization_ = 0; + /// + /// Arithmetic optimizations (default is ON) + /// e.g. Simplify arithmetic ops; merge ops with same value (like constants). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle ArithmeticOptimization { + get { return arithmeticOptimization_; } + set { + arithmeticOptimization_ = value; + } + } + + /// Field number for the "dependency_optimization" field. + public const int DependencyOptimizationFieldNumber = 8; + private global::Tensorflow.RewriterConfig.Types.Toggle dependencyOptimization_ = 0; + /// + /// Control dependency optimizations (default is ON). + /// Remove redundant control dependencies, which may enable other optimization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle DependencyOptimization { + get { return dependencyOptimization_; } + set { + dependencyOptimization_ = value; + } + } + + /// Field number for the "loop_optimization" field. + public const int LoopOptimizationFieldNumber = 9; + private global::Tensorflow.RewriterConfig.Types.Toggle loopOptimization_ = 0; + /// + /// Loop optimizations (default is ON). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle LoopOptimization { + get { return loopOptimization_; } + set { + loopOptimization_ = value; + } + } + + /// Field number for the "function_optimization" field. + public const int FunctionOptimizationFieldNumber = 10; + private global::Tensorflow.RewriterConfig.Types.Toggle functionOptimization_ = 0; + /// + /// Function optimizations (default is ON). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle FunctionOptimization { + get { return functionOptimization_; } + set { + functionOptimization_ = value; + } + } + + /// Field number for the "debug_stripper" field. + public const int DebugStripperFieldNumber = 11; + private global::Tensorflow.RewriterConfig.Types.Toggle debugStripper_ = 0; + /// + /// Strips debug-related nodes from the graph (off by default). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle DebugStripper { + get { return debugStripper_; } + set { + debugStripper_ = value; + } + } + + /// Field number for the "disable_model_pruning" field. + public const int DisableModelPruningFieldNumber = 2; + private bool disableModelPruning_; + /// + /// If true, don't remove unnecessary ops from the graph + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool DisableModelPruning { + get { return disableModelPruning_; } + set { + disableModelPruning_ = value; + } + } + + /// Field number for the "scoped_allocator_optimization" field. + public const int ScopedAllocatorOptimizationFieldNumber = 15; + private global::Tensorflow.RewriterConfig.Types.Toggle scopedAllocatorOptimization_ = 0; + /// + /// Try to allocate some independent Op outputs contiguously in order to + /// merge or eliminate downstream Ops (off by default). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle ScopedAllocatorOptimization { + get { return scopedAllocatorOptimization_; } + set { + scopedAllocatorOptimization_ = value; + } + } + + /// Field number for the "pin_to_host_optimization" field. + public const int PinToHostOptimizationFieldNumber = 18; + private global::Tensorflow.RewriterConfig.Types.Toggle pinToHostOptimization_ = 0; + /// + /// Force small ops onto the CPU (default is OFF). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.Toggle PinToHostOptimization { + get { return pinToHostOptimization_; } + set { + pinToHostOptimization_ = value; + } + } + + /// Field number for the "disable_meta_optimizer" field. + public const int DisableMetaOptimizerFieldNumber = 19; + private bool disableMetaOptimizer_; + /// + /// Disable the entire meta optimizer (off by default). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool DisableMetaOptimizer { + get { return disableMetaOptimizer_; } + set { + disableMetaOptimizer_ = value; + } + } + + /// Field number for the "meta_optimizer_iterations" field. + public const int MetaOptimizerIterationsFieldNumber = 12; + private global::Tensorflow.RewriterConfig.Types.NumIterationsType metaOptimizerIterations_ = 0; + /// + /// Controls how many times we run the optimizers in meta optimizer (default + /// is once). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.NumIterationsType MetaOptimizerIterations { + get { return metaOptimizerIterations_; } + set { + metaOptimizerIterations_ = value; + } + } + + /// Field number for the "min_graph_nodes" field. + public const int MinGraphNodesFieldNumber = 17; + private int minGraphNodes_; + /// + /// The minimum number of nodes in a graph to optimizer. For smaller graphs, + /// optimization is skipped. + /// 0 means the system picks an appropriate number. + /// < 0 means do not skip optimization. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int MinGraphNodes { + get { return minGraphNodes_; } + set { + minGraphNodes_ = value; + } + } + + /// Field number for the "memory_optimization" field. + public const int MemoryOptimizationFieldNumber = 4; + private global::Tensorflow.RewriterConfig.Types.MemOptType memoryOptimization_ = 0; + /// + /// Configures memory optimization passes through the meta-optimizer. Has no + /// effect on manually requested memory optimization passes in the optimizers + /// field. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.RewriterConfig.Types.MemOptType MemoryOptimization { + get { return memoryOptimization_; } + set { + memoryOptimization_ = value; + } + } + + /// Field number for the "memory_optimizer_target_node_name_scope" field. + public const int MemoryOptimizerTargetNodeNameScopeFieldNumber = 6; + private string memoryOptimizerTargetNodeNameScope_ = ""; + /// + /// A node name scope for node names which are valid outputs of recompuations. + /// Inputs to nodes that match this scope may be recomputed (subject either to + /// manual annotation of those input nodes or to manual annotation and + /// heuristics depending on memory_optimization), but the nodes themselves will + /// not be recomputed. This matches any sub-scopes as well, meaning the scope + /// can appear not just as a top-level scope. For example, if the value is + /// "gradients/", the default, it will match node name "gradients/foo", + /// "foo/gradients/bar", but not "foo_gradients/" + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string MemoryOptimizerTargetNodeNameScope { + get { return memoryOptimizerTargetNodeNameScope_; } + set { + memoryOptimizerTargetNodeNameScope_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "meta_optimizer_timeout_ms" field. + public const int MetaOptimizerTimeoutMsFieldNumber = 20; + private long metaOptimizerTimeoutMs_; + /// + /// Maximum number of milliseconds to spend optimizing a single graph before + /// timing out. If equal to 0 the system picks a default (currently 5 minutes). + /// If less than 0 the optimizer will never time out. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long MetaOptimizerTimeoutMs { + get { return metaOptimizerTimeoutMs_; } + set { + metaOptimizerTimeoutMs_ = value; + } + } + + /// Field number for the "auto_parallel" field. + public const int AutoParallelFieldNumber = 5; + private global::Tensorflow.AutoParallelOptions autoParallel_; + /// + /// Configures AutoParallel optimization passes either through the + /// meta-optimizer or when manually specified through the optimizers field. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.AutoParallelOptions AutoParallel { + get { return autoParallel_; } + set { + autoParallel_ = value; + } + } + + /// Field number for the "fail_on_optimizer_errors" field. + public const int FailOnOptimizerErrorsFieldNumber = 21; + private bool failOnOptimizerErrors_; + /// + /// If true, any optimization pass failing will cause the MetaOptimizer to + /// stop with an error. By default - or when set to false, failing passes are + /// skipped silently. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool FailOnOptimizerErrors { + get { return failOnOptimizerErrors_; } + set { + failOnOptimizerErrors_ = value; + } + } + + /// Field number for the "scoped_allocator_opts" field. + public const int ScopedAllocatorOptsFieldNumber = 16; + private global::Tensorflow.ScopedAllocatorOptions scopedAllocatorOpts_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.ScopedAllocatorOptions ScopedAllocatorOpts { + get { return scopedAllocatorOpts_; } + set { + scopedAllocatorOpts_ = value; + } + } + + /// Field number for the "optimizers" field. + public const int OptimizersFieldNumber = 100; + private static readonly pb::FieldCodec _repeated_optimizers_codec + = pb::FieldCodec.ForString(802); + private readonly pbc::RepeatedField optimizers_ = new pbc::RepeatedField(); + /// + /// If non-empty, will use this as an alternative way to specify a list of + /// optimizations to turn on and the order of the optimizations (replacing the + /// meta-optimizer). + /// + /// Of the RewriterConfig options, only the AutoParallel configuration options + /// (the auto_parallel field) apply to manually requested optimization passes + /// ("autoparallel"). Memory optimization passes ("memory") invoked here are + /// not configurable (in contrast to memory optimization passes through the + /// meta-optimizer) and act only on manual op annotations. + /// + /// Custom optimizers (see custom_optimizers) that are not part of this + /// schedule will be run after - in the order that they were specified. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Optimizers { + get { return optimizers_; } + } + + /// Field number for the "custom_optimizers" field. + public const int CustomOptimizersFieldNumber = 200; + private static readonly pb::FieldCodec _repeated_customOptimizers_codec + = pb::FieldCodec.ForMessage(1602, global::Tensorflow.RewriterConfig.Types.CustomGraphOptimizer.Parser); + private readonly pbc::RepeatedField customOptimizers_ = new pbc::RepeatedField(); + /// + /// list of CustomGraphOptimizers to apply. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField CustomOptimizers { + get { return customOptimizers_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RewriterConfig); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RewriterConfig other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (LayoutOptimizer != other.LayoutOptimizer) return false; + if (ConstantFolding != other.ConstantFolding) return false; + if (ShapeOptimization != other.ShapeOptimization) return false; + if (Remapping != other.Remapping) return false; + if (ArithmeticOptimization != other.ArithmeticOptimization) return false; + if (DependencyOptimization != other.DependencyOptimization) return false; + if (LoopOptimization != other.LoopOptimization) return false; + if (FunctionOptimization != other.FunctionOptimization) return false; + if (DebugStripper != other.DebugStripper) return false; + if (DisableModelPruning != other.DisableModelPruning) return false; + if (ScopedAllocatorOptimization != other.ScopedAllocatorOptimization) return false; + if (PinToHostOptimization != other.PinToHostOptimization) return false; + if (DisableMetaOptimizer != other.DisableMetaOptimizer) return false; + if (MetaOptimizerIterations != other.MetaOptimizerIterations) return false; + if (MinGraphNodes != other.MinGraphNodes) return false; + if (MemoryOptimization != other.MemoryOptimization) return false; + if (MemoryOptimizerTargetNodeNameScope != other.MemoryOptimizerTargetNodeNameScope) return false; + if (MetaOptimizerTimeoutMs != other.MetaOptimizerTimeoutMs) return false; + if (!object.Equals(AutoParallel, other.AutoParallel)) return false; + if (FailOnOptimizerErrors != other.FailOnOptimizerErrors) return false; + if (!object.Equals(ScopedAllocatorOpts, other.ScopedAllocatorOpts)) return false; + if(!optimizers_.Equals(other.optimizers_)) return false; + if(!customOptimizers_.Equals(other.customOptimizers_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (LayoutOptimizer != 0) hash ^= LayoutOptimizer.GetHashCode(); + if (ConstantFolding != 0) hash ^= ConstantFolding.GetHashCode(); + if (ShapeOptimization != 0) hash ^= ShapeOptimization.GetHashCode(); + if (Remapping != 0) hash ^= Remapping.GetHashCode(); + if (ArithmeticOptimization != 0) hash ^= ArithmeticOptimization.GetHashCode(); + if (DependencyOptimization != 0) hash ^= DependencyOptimization.GetHashCode(); + if (LoopOptimization != 0) hash ^= LoopOptimization.GetHashCode(); + if (FunctionOptimization != 0) hash ^= FunctionOptimization.GetHashCode(); + if (DebugStripper != 0) hash ^= DebugStripper.GetHashCode(); + if (DisableModelPruning != false) hash ^= DisableModelPruning.GetHashCode(); + if (ScopedAllocatorOptimization != 0) hash ^= ScopedAllocatorOptimization.GetHashCode(); + if (PinToHostOptimization != 0) hash ^= PinToHostOptimization.GetHashCode(); + if (DisableMetaOptimizer != false) hash ^= DisableMetaOptimizer.GetHashCode(); + if (MetaOptimizerIterations != 0) hash ^= MetaOptimizerIterations.GetHashCode(); + if (MinGraphNodes != 0) hash ^= MinGraphNodes.GetHashCode(); + if (MemoryOptimization != 0) hash ^= MemoryOptimization.GetHashCode(); + if (MemoryOptimizerTargetNodeNameScope.Length != 0) hash ^= MemoryOptimizerTargetNodeNameScope.GetHashCode(); + if (MetaOptimizerTimeoutMs != 0L) hash ^= MetaOptimizerTimeoutMs.GetHashCode(); + if (autoParallel_ != null) hash ^= AutoParallel.GetHashCode(); + if (FailOnOptimizerErrors != false) hash ^= FailOnOptimizerErrors.GetHashCode(); + if (scopedAllocatorOpts_ != null) hash ^= ScopedAllocatorOpts.GetHashCode(); + hash ^= optimizers_.GetHashCode(); + hash ^= customOptimizers_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (LayoutOptimizer != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) LayoutOptimizer); + } + if (DisableModelPruning != false) { + output.WriteRawTag(16); + output.WriteBool(DisableModelPruning); + } + if (ConstantFolding != 0) { + output.WriteRawTag(24); + output.WriteEnum((int) ConstantFolding); + } + if (MemoryOptimization != 0) { + output.WriteRawTag(32); + output.WriteEnum((int) MemoryOptimization); + } + if (autoParallel_ != null) { + output.WriteRawTag(42); + output.WriteMessage(AutoParallel); + } + if (MemoryOptimizerTargetNodeNameScope.Length != 0) { + output.WriteRawTag(50); + output.WriteString(MemoryOptimizerTargetNodeNameScope); + } + if (ArithmeticOptimization != 0) { + output.WriteRawTag(56); + output.WriteEnum((int) ArithmeticOptimization); + } + if (DependencyOptimization != 0) { + output.WriteRawTag(64); + output.WriteEnum((int) DependencyOptimization); + } + if (LoopOptimization != 0) { + output.WriteRawTag(72); + output.WriteEnum((int) LoopOptimization); + } + if (FunctionOptimization != 0) { + output.WriteRawTag(80); + output.WriteEnum((int) FunctionOptimization); + } + if (DebugStripper != 0) { + output.WriteRawTag(88); + output.WriteEnum((int) DebugStripper); + } + if (MetaOptimizerIterations != 0) { + output.WriteRawTag(96); + output.WriteEnum((int) MetaOptimizerIterations); + } + if (ShapeOptimization != 0) { + output.WriteRawTag(104); + output.WriteEnum((int) ShapeOptimization); + } + if (Remapping != 0) { + output.WriteRawTag(112); + output.WriteEnum((int) Remapping); + } + if (ScopedAllocatorOptimization != 0) { + output.WriteRawTag(120); + output.WriteEnum((int) ScopedAllocatorOptimization); + } + if (scopedAllocatorOpts_ != null) { + output.WriteRawTag(130, 1); + output.WriteMessage(ScopedAllocatorOpts); + } + if (MinGraphNodes != 0) { + output.WriteRawTag(136, 1); + output.WriteInt32(MinGraphNodes); + } + if (PinToHostOptimization != 0) { + output.WriteRawTag(144, 1); + output.WriteEnum((int) PinToHostOptimization); + } + if (DisableMetaOptimizer != false) { + output.WriteRawTag(152, 1); + output.WriteBool(DisableMetaOptimizer); + } + if (MetaOptimizerTimeoutMs != 0L) { + output.WriteRawTag(160, 1); + output.WriteInt64(MetaOptimizerTimeoutMs); + } + if (FailOnOptimizerErrors != false) { + output.WriteRawTag(168, 1); + output.WriteBool(FailOnOptimizerErrors); + } + optimizers_.WriteTo(output, _repeated_optimizers_codec); + customOptimizers_.WriteTo(output, _repeated_customOptimizers_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (LayoutOptimizer != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LayoutOptimizer); + } + if (ConstantFolding != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ConstantFolding); + } + if (ShapeOptimization != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ShapeOptimization); + } + if (Remapping != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Remapping); + } + if (ArithmeticOptimization != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ArithmeticOptimization); + } + if (DependencyOptimization != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DependencyOptimization); + } + if (LoopOptimization != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LoopOptimization); + } + if (FunctionOptimization != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) FunctionOptimization); + } + if (DebugStripper != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DebugStripper); + } + if (DisableModelPruning != false) { + size += 1 + 1; + } + if (ScopedAllocatorOptimization != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ScopedAllocatorOptimization); + } + if (PinToHostOptimization != 0) { + size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) PinToHostOptimization); + } + if (DisableMetaOptimizer != false) { + size += 2 + 1; + } + if (MetaOptimizerIterations != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MetaOptimizerIterations); + } + if (MinGraphNodes != 0) { + size += 2 + pb::CodedOutputStream.ComputeInt32Size(MinGraphNodes); + } + if (MemoryOptimization != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MemoryOptimization); + } + if (MemoryOptimizerTargetNodeNameScope.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(MemoryOptimizerTargetNodeNameScope); + } + if (MetaOptimizerTimeoutMs != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(MetaOptimizerTimeoutMs); + } + if (autoParallel_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(AutoParallel); + } + if (FailOnOptimizerErrors != false) { + size += 2 + 1; + } + if (scopedAllocatorOpts_ != null) { + size += 2 + pb::CodedOutputStream.ComputeMessageSize(ScopedAllocatorOpts); + } + size += optimizers_.CalculateSize(_repeated_optimizers_codec); + size += customOptimizers_.CalculateSize(_repeated_customOptimizers_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RewriterConfig other) { + if (other == null) { + return; + } + if (other.LayoutOptimizer != 0) { + LayoutOptimizer = other.LayoutOptimizer; + } + if (other.ConstantFolding != 0) { + ConstantFolding = other.ConstantFolding; + } + if (other.ShapeOptimization != 0) { + ShapeOptimization = other.ShapeOptimization; + } + if (other.Remapping != 0) { + Remapping = other.Remapping; + } + if (other.ArithmeticOptimization != 0) { + ArithmeticOptimization = other.ArithmeticOptimization; + } + if (other.DependencyOptimization != 0) { + DependencyOptimization = other.DependencyOptimization; + } + if (other.LoopOptimization != 0) { + LoopOptimization = other.LoopOptimization; + } + if (other.FunctionOptimization != 0) { + FunctionOptimization = other.FunctionOptimization; + } + if (other.DebugStripper != 0) { + DebugStripper = other.DebugStripper; + } + if (other.DisableModelPruning != false) { + DisableModelPruning = other.DisableModelPruning; + } + if (other.ScopedAllocatorOptimization != 0) { + ScopedAllocatorOptimization = other.ScopedAllocatorOptimization; + } + if (other.PinToHostOptimization != 0) { + PinToHostOptimization = other.PinToHostOptimization; + } + if (other.DisableMetaOptimizer != false) { + DisableMetaOptimizer = other.DisableMetaOptimizer; + } + if (other.MetaOptimizerIterations != 0) { + MetaOptimizerIterations = other.MetaOptimizerIterations; + } + if (other.MinGraphNodes != 0) { + MinGraphNodes = other.MinGraphNodes; + } + if (other.MemoryOptimization != 0) { + MemoryOptimization = other.MemoryOptimization; + } + if (other.MemoryOptimizerTargetNodeNameScope.Length != 0) { + MemoryOptimizerTargetNodeNameScope = other.MemoryOptimizerTargetNodeNameScope; + } + if (other.MetaOptimizerTimeoutMs != 0L) { + MetaOptimizerTimeoutMs = other.MetaOptimizerTimeoutMs; + } + if (other.autoParallel_ != null) { + if (autoParallel_ == null) { + autoParallel_ = new global::Tensorflow.AutoParallelOptions(); + } + AutoParallel.MergeFrom(other.AutoParallel); + } + if (other.FailOnOptimizerErrors != false) { + FailOnOptimizerErrors = other.FailOnOptimizerErrors; + } + if (other.scopedAllocatorOpts_ != null) { + if (scopedAllocatorOpts_ == null) { + scopedAllocatorOpts_ = new global::Tensorflow.ScopedAllocatorOptions(); + } + ScopedAllocatorOpts.MergeFrom(other.ScopedAllocatorOpts); + } + optimizers_.Add(other.optimizers_); + customOptimizers_.Add(other.customOptimizers_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + layoutOptimizer_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 16: { + DisableModelPruning = input.ReadBool(); + break; + } + case 24: { + constantFolding_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 32: { + memoryOptimization_ = (global::Tensorflow.RewriterConfig.Types.MemOptType) input.ReadEnum(); + break; + } + case 42: { + if (autoParallel_ == null) { + autoParallel_ = new global::Tensorflow.AutoParallelOptions(); + } + input.ReadMessage(autoParallel_); + break; + } + case 50: { + MemoryOptimizerTargetNodeNameScope = input.ReadString(); + break; + } + case 56: { + arithmeticOptimization_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 64: { + dependencyOptimization_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 72: { + loopOptimization_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 80: { + functionOptimization_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 88: { + debugStripper_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 96: { + metaOptimizerIterations_ = (global::Tensorflow.RewriterConfig.Types.NumIterationsType) input.ReadEnum(); + break; + } + case 104: { + shapeOptimization_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 112: { + remapping_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 120: { + scopedAllocatorOptimization_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 130: { + if (scopedAllocatorOpts_ == null) { + scopedAllocatorOpts_ = new global::Tensorflow.ScopedAllocatorOptions(); + } + input.ReadMessage(scopedAllocatorOpts_); + break; + } + case 136: { + MinGraphNodes = input.ReadInt32(); + break; + } + case 144: { + pinToHostOptimization_ = (global::Tensorflow.RewriterConfig.Types.Toggle) input.ReadEnum(); + break; + } + case 152: { + DisableMetaOptimizer = input.ReadBool(); + break; + } + case 160: { + MetaOptimizerTimeoutMs = input.ReadInt64(); + break; + } + case 168: { + FailOnOptimizerErrors = input.ReadBool(); + break; + } + case 802: { + optimizers_.AddEntriesFrom(input, _repeated_optimizers_codec); + break; + } + case 1602: { + customOptimizers_.AddEntriesFrom(input, _repeated_customOptimizers_codec); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the RewriterConfig message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + public enum Toggle { + [pbr::OriginalName("DEFAULT")] Default = 0, + [pbr::OriginalName("ON")] On = 1, + [pbr::OriginalName("OFF")] Off = 2, + /// + /// Enable some aggressive optimizations that use assumptions that TF graphs + /// may break. For example, assume the shape of a placeholder matches its + /// actual feed. + /// + [pbr::OriginalName("AGGRESSIVE")] Aggressive = 3, + } + + /// + /// Enum controlling the number of times to run optimizers. The default is to + /// run them twice. + /// + public enum NumIterationsType { + [pbr::OriginalName("DEFAULT_NUM_ITERS")] DefaultNumIters = 0, + [pbr::OriginalName("ONE")] One = 1, + [pbr::OriginalName("TWO")] Two = 2, + } + + public enum MemOptType { + /// + /// The default setting (SCHEDULING and SWAPPING HEURISTICS only) + /// + [pbr::OriginalName("DEFAULT_MEM_OPT")] DefaultMemOpt = 0, + /// + /// Disabled in the meta-optimizer. + /// + [pbr::OriginalName("NO_MEM_OPT")] NoMemOpt = 1, + /// + /// Driven by manual op-level annotations. + /// + [pbr::OriginalName("MANUAL")] Manual = 2, + /// + /// Swapping heuristic will move a tensor from the GPU to the CPU and move + /// it back when needed to reduce peak memory usage. + /// + [pbr::OriginalName("SWAPPING_HEURISTICS")] SwappingHeuristics = 4, + /// + /// Recomputation heuristics will recompute ops (such as Relu activation) + /// during backprop instead of storing them, reducing peak memory usage. + /// + [pbr::OriginalName("RECOMPUTATION_HEURISTICS")] RecomputationHeuristics = 5, + /// + /// Scheduling will split big ops such as AddN and try to enforce a schedule + /// of the new computations that decreases peak memory usage. + /// + [pbr::OriginalName("SCHEDULING_HEURISTICS")] SchedulingHeuristics = 6, + /// + /// Use any combination of swapping and recomputation heuristics. + /// + [pbr::OriginalName("HEURISTICS")] Heuristics = 3, + } + + /// + /// Message to describe custom graph optimizer and its parameters + /// + public sealed partial class CustomGraphOptimizer : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CustomGraphOptimizer()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.RewriterConfig.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CustomGraphOptimizer() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CustomGraphOptimizer(CustomGraphOptimizer other) : this() { + name_ = other.name_; + parameterMap_ = other.parameterMap_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public CustomGraphOptimizer Clone() { + return new CustomGraphOptimizer(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "parameter_map" field. + public const int ParameterMapFieldNumber = 2; + private static readonly pbc::MapField.Codec _map_parameterMap_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Tensorflow.AttrValue.Parser), 18); + private readonly pbc::MapField parameterMap_ = new pbc::MapField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::MapField ParameterMap { + get { return parameterMap_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as CustomGraphOptimizer); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(CustomGraphOptimizer other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (!ParameterMap.Equals(other.ParameterMap)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + hash ^= ParameterMap.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + parameterMap_.WriteTo(output, _map_parameterMap_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + size += parameterMap_.CalculateSize(_map_parameterMap_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(CustomGraphOptimizer other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + parameterMap_.Add(other.parameterMap_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + parameterMap_.AddEntriesFrom(input, _map_parameterMap_codec); + break; + } + } + } + } + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/StepStats.cs b/src/TensorFlowNET.Core/Protobuf/StepStats.cs new file mode 100644 index 00000000..602d1d70 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/StepStats.cs @@ -0,0 +1,1787 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/step_stats.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/step_stats.proto + public static partial class StepStatsReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/step_stats.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static StepStatsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cip0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3N0ZXBfc3RhdHMucHJvdG8S", + "CnRlbnNvcmZsb3caNnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvYWxsb2Nh", + "dGlvbl9kZXNjcmlwdGlvbi5wcm90bxoydGVuc29yZmxvdy9jb3JlL2ZyYW1l", + "d29yay90ZW5zb3JfZGVzY3JpcHRpb24ucHJvdG8iPQoQQWxsb2NhdGlvblJl", + "Y29yZBIUCgxhbGxvY19taWNyb3MYASABKAMSEwoLYWxsb2NfYnl0ZXMYAiAB", + "KAMixAEKE0FsbG9jYXRvck1lbW9yeVVzZWQSFgoOYWxsb2NhdG9yX25hbWUY", + "ASABKAkSEwoLdG90YWxfYnl0ZXMYAiABKAMSEgoKcGVha19ieXRlcxgDIAEo", + "AxISCgpsaXZlX2J5dGVzGAQgASgDEjgKEmFsbG9jYXRpb25fcmVjb3JkcxgG", + "IAMoCzIcLnRlbnNvcmZsb3cuQWxsb2NhdGlvblJlY29yZBIeChZhbGxvY2F0", + "b3JfYnl0ZXNfaW5fdXNlGAUgASgDIlUKCk5vZGVPdXRwdXQSDAoEc2xvdBgB", + "IAEoBRI5ChJ0ZW5zb3JfZGVzY3JpcHRpb24YAyABKAsyHS50ZW5zb3JmbG93", + "LlRlbnNvckRlc2NyaXB0aW9uIuwBCgtNZW1vcnlTdGF0cxIYChB0ZW1wX21l", + "bW9yeV9zaXplGAEgASgDEh4KFnBlcnNpc3RlbnRfbWVtb3J5X3NpemUYAyAB", + "KAMSIwobcGVyc2lzdGVudF90ZW5zb3JfYWxsb2NfaWRzGAUgAygDEiMKF2Rl", + "dmljZV90ZW1wX21lbW9yeV9zaXplGAIgASgDQgIYARIpCh1kZXZpY2VfcGVy", + "c2lzdGVudF9tZW1vcnlfc2l6ZRgEIAEoA0ICGAESLgoiZGV2aWNlX3BlcnNp", + "c3RlbnRfdGVuc29yX2FsbG9jX2lkcxgGIAMoA0ICGAEingQKDU5vZGVFeGVj", + "U3RhdHMSEQoJbm9kZV9uYW1lGAEgASgJEhgKEGFsbF9zdGFydF9taWNyb3MY", + "AiABKAMSGwoTb3Bfc3RhcnRfcmVsX21pY3JvcxgDIAEoAxIZChFvcF9lbmRf", + "cmVsX21pY3JvcxgEIAEoAxIaChJhbGxfZW5kX3JlbF9taWNyb3MYBSABKAMS", + "LwoGbWVtb3J5GAYgAygLMh8udGVuc29yZmxvdy5BbGxvY2F0b3JNZW1vcnlV", + "c2VkEiYKBm91dHB1dBgHIAMoCzIWLnRlbnNvcmZsb3cuTm9kZU91dHB1dBIW", + "Cg50aW1lbGluZV9sYWJlbBgIIAEoCRIYChBzY2hlZHVsZWRfbWljcm9zGAkg", + "ASgDEhEKCXRocmVhZF9pZBgKIAEoDRI8ChFyZWZlcmVuY2VkX3RlbnNvchgL", + "IAMoCzIhLnRlbnNvcmZsb3cuQWxsb2NhdGlvbkRlc2NyaXB0aW9uEi0KDG1l", + "bW9yeV9zdGF0cxgMIAEoCzIXLnRlbnNvcmZsb3cuTWVtb3J5U3RhdHMSFwoP", + "YWxsX3N0YXJ0X25hbm9zGA0gASgDEhoKEm9wX3N0YXJ0X3JlbF9uYW5vcxgO", + "IAEoAxIYChBvcF9lbmRfcmVsX25hbm9zGA8gASgDEhkKEWFsbF9lbmRfcmVs", + "X25hbm9zGBAgASgDEhcKD3NjaGVkdWxlZF9uYW5vcxgRIAEoAyJQCg9EZXZp", + "Y2VTdGVwU3RhdHMSDgoGZGV2aWNlGAEgASgJEi0KCm5vZGVfc3RhdHMYAiAD", + "KAsyGS50ZW5zb3JmbG93Lk5vZGVFeGVjU3RhdHMiOwoJU3RlcFN0YXRzEi4K", + "CWRldl9zdGF0cxgBIAMoCzIbLnRlbnNvcmZsb3cuRGV2aWNlU3RlcFN0YXRz", + "Qm8KGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IPU3RlcFN0YXRzUHJvdG9z", + "UAFaPWdpdGh1Yi5jb20vdGVuc29yZmxvdy90ZW5zb3JmbG93L3RlbnNvcmZs", + "b3cvZ28vY29yZS9mcmFtZXdvcmv4AQFiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tensorflow.AllocationDescriptionReflection.Descriptor, global::Tensorflow.TensorDescriptionReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AllocationRecord), global::Tensorflow.AllocationRecord.Parser, new[]{ "AllocMicros", "AllocBytes" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AllocatorMemoryUsed), global::Tensorflow.AllocatorMemoryUsed.Parser, new[]{ "AllocatorName", "TotalBytes", "PeakBytes", "LiveBytes", "AllocationRecords", "AllocatorBytesInUse" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.NodeOutput), global::Tensorflow.NodeOutput.Parser, new[]{ "Slot", "TensorDescription" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.MemoryStats), global::Tensorflow.MemoryStats.Parser, new[]{ "TempMemorySize", "PersistentMemorySize", "PersistentTensorAllocIds", "DeviceTempMemorySize", "DevicePersistentMemorySize", "DevicePersistentTensorAllocIds" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.NodeExecStats), global::Tensorflow.NodeExecStats.Parser, new[]{ "NodeName", "AllStartMicros", "OpStartRelMicros", "OpEndRelMicros", "AllEndRelMicros", "Memory", "Output", "TimelineLabel", "ScheduledMicros", "ThreadId", "ReferencedTensor", "MemoryStats", "AllStartNanos", "OpStartRelNanos", "OpEndRelNanos", "AllEndRelNanos", "ScheduledNanos" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.DeviceStepStats), global::Tensorflow.DeviceStepStats.Parser, new[]{ "Device", "NodeStats" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.StepStats), global::Tensorflow.StepStats.Parser, new[]{ "DevStats" }, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// An allocation/de-allocation operation performed by the allocator. + /// + public sealed partial class AllocationRecord : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AllocationRecord()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.StepStatsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllocationRecord() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllocationRecord(AllocationRecord other) : this() { + allocMicros_ = other.allocMicros_; + allocBytes_ = other.allocBytes_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllocationRecord Clone() { + return new AllocationRecord(this); + } + + /// Field number for the "alloc_micros" field. + public const int AllocMicrosFieldNumber = 1; + private long allocMicros_; + /// + /// The timestamp of the operation. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllocMicros { + get { return allocMicros_; } + set { + allocMicros_ = value; + } + } + + /// Field number for the "alloc_bytes" field. + public const int AllocBytesFieldNumber = 2; + private long allocBytes_; + /// + /// Number of bytes allocated, or de-allocated if negative. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllocBytes { + get { return allocBytes_; } + set { + allocBytes_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AllocationRecord); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AllocationRecord other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (AllocMicros != other.AllocMicros) return false; + if (AllocBytes != other.AllocBytes) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (AllocMicros != 0L) hash ^= AllocMicros.GetHashCode(); + if (AllocBytes != 0L) hash ^= AllocBytes.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (AllocMicros != 0L) { + output.WriteRawTag(8); + output.WriteInt64(AllocMicros); + } + if (AllocBytes != 0L) { + output.WriteRawTag(16); + output.WriteInt64(AllocBytes); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (AllocMicros != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocMicros); + } + if (AllocBytes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocBytes); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AllocationRecord other) { + if (other == null) { + return; + } + if (other.AllocMicros != 0L) { + AllocMicros = other.AllocMicros; + } + if (other.AllocBytes != 0L) { + AllocBytes = other.AllocBytes; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + AllocMicros = input.ReadInt64(); + break; + } + case 16: { + AllocBytes = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class AllocatorMemoryUsed : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AllocatorMemoryUsed()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.StepStatsReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllocatorMemoryUsed() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllocatorMemoryUsed(AllocatorMemoryUsed other) : this() { + allocatorName_ = other.allocatorName_; + totalBytes_ = other.totalBytes_; + peakBytes_ = other.peakBytes_; + liveBytes_ = other.liveBytes_; + allocationRecords_ = other.allocationRecords_.Clone(); + allocatorBytesInUse_ = other.allocatorBytesInUse_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AllocatorMemoryUsed Clone() { + return new AllocatorMemoryUsed(this); + } + + /// Field number for the "allocator_name" field. + public const int AllocatorNameFieldNumber = 1; + private string allocatorName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string AllocatorName { + get { return allocatorName_; } + set { + allocatorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "total_bytes" field. + public const int TotalBytesFieldNumber = 2; + private long totalBytes_; + /// + /// These are per-node allocator memory stats. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long TotalBytes { + get { return totalBytes_; } + set { + totalBytes_ = value; + } + } + + /// Field number for the "peak_bytes" field. + public const int PeakBytesFieldNumber = 3; + private long peakBytes_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long PeakBytes { + get { return peakBytes_; } + set { + peakBytes_ = value; + } + } + + /// Field number for the "live_bytes" field. + public const int LiveBytesFieldNumber = 4; + private long liveBytes_; + /// + /// The bytes that are not deallocated. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long LiveBytes { + get { return liveBytes_; } + set { + liveBytes_ = value; + } + } + + /// Field number for the "allocation_records" field. + public const int AllocationRecordsFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_allocationRecords_codec + = pb::FieldCodec.ForMessage(50, global::Tensorflow.AllocationRecord.Parser); + private readonly pbc::RepeatedField allocationRecords_ = new pbc::RepeatedField(); + /// + /// The allocation and deallocation timeline. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField AllocationRecords { + get { return allocationRecords_; } + } + + /// Field number for the "allocator_bytes_in_use" field. + public const int AllocatorBytesInUseFieldNumber = 5; + private long allocatorBytesInUse_; + /// + /// These are snapshots of the overall allocator memory stats. + /// The number of live bytes currently allocated by the allocator. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllocatorBytesInUse { + get { return allocatorBytesInUse_; } + set { + allocatorBytesInUse_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AllocatorMemoryUsed); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AllocatorMemoryUsed other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (AllocatorName != other.AllocatorName) return false; + if (TotalBytes != other.TotalBytes) return false; + if (PeakBytes != other.PeakBytes) return false; + if (LiveBytes != other.LiveBytes) return false; + if(!allocationRecords_.Equals(other.allocationRecords_)) return false; + if (AllocatorBytesInUse != other.AllocatorBytesInUse) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (AllocatorName.Length != 0) hash ^= AllocatorName.GetHashCode(); + if (TotalBytes != 0L) hash ^= TotalBytes.GetHashCode(); + if (PeakBytes != 0L) hash ^= PeakBytes.GetHashCode(); + if (LiveBytes != 0L) hash ^= LiveBytes.GetHashCode(); + hash ^= allocationRecords_.GetHashCode(); + if (AllocatorBytesInUse != 0L) hash ^= AllocatorBytesInUse.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (AllocatorName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(AllocatorName); + } + if (TotalBytes != 0L) { + output.WriteRawTag(16); + output.WriteInt64(TotalBytes); + } + if (PeakBytes != 0L) { + output.WriteRawTag(24); + output.WriteInt64(PeakBytes); + } + if (LiveBytes != 0L) { + output.WriteRawTag(32); + output.WriteInt64(LiveBytes); + } + if (AllocatorBytesInUse != 0L) { + output.WriteRawTag(40); + output.WriteInt64(AllocatorBytesInUse); + } + allocationRecords_.WriteTo(output, _repeated_allocationRecords_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (AllocatorName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(AllocatorName); + } + if (TotalBytes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TotalBytes); + } + if (PeakBytes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PeakBytes); + } + if (LiveBytes != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(LiveBytes); + } + size += allocationRecords_.CalculateSize(_repeated_allocationRecords_codec); + if (AllocatorBytesInUse != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocatorBytesInUse); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AllocatorMemoryUsed other) { + if (other == null) { + return; + } + if (other.AllocatorName.Length != 0) { + AllocatorName = other.AllocatorName; + } + if (other.TotalBytes != 0L) { + TotalBytes = other.TotalBytes; + } + if (other.PeakBytes != 0L) { + PeakBytes = other.PeakBytes; + } + if (other.LiveBytes != 0L) { + LiveBytes = other.LiveBytes; + } + allocationRecords_.Add(other.allocationRecords_); + if (other.AllocatorBytesInUse != 0L) { + AllocatorBytesInUse = other.AllocatorBytesInUse; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + AllocatorName = input.ReadString(); + break; + } + case 16: { + TotalBytes = input.ReadInt64(); + break; + } + case 24: { + PeakBytes = input.ReadInt64(); + break; + } + case 32: { + LiveBytes = input.ReadInt64(); + break; + } + case 40: { + AllocatorBytesInUse = input.ReadInt64(); + break; + } + case 50: { + allocationRecords_.AddEntriesFrom(input, _repeated_allocationRecords_codec); + break; + } + } + } + } + + } + + /// + /// Output sizes recorded for a single execution of a graph node. + /// + public sealed partial class NodeOutput : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NodeOutput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.StepStatsReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NodeOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NodeOutput(NodeOutput other) : this() { + slot_ = other.slot_; + tensorDescription_ = other.tensorDescription_ != null ? other.tensorDescription_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NodeOutput Clone() { + return new NodeOutput(this); + } + + /// Field number for the "slot" field. + public const int SlotFieldNumber = 1; + private int slot_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Slot { + get { return slot_; } + set { + slot_ = value; + } + } + + /// Field number for the "tensor_description" field. + public const int TensorDescriptionFieldNumber = 3; + private global::Tensorflow.TensorDescription tensorDescription_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.TensorDescription TensorDescription { + get { return tensorDescription_; } + set { + tensorDescription_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as NodeOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(NodeOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Slot != other.Slot) return false; + if (!object.Equals(TensorDescription, other.TensorDescription)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Slot != 0) hash ^= Slot.GetHashCode(); + if (tensorDescription_ != null) hash ^= TensorDescription.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Slot != 0) { + output.WriteRawTag(8); + output.WriteInt32(Slot); + } + if (tensorDescription_ != null) { + output.WriteRawTag(26); + output.WriteMessage(TensorDescription); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Slot != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Slot); + } + if (tensorDescription_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TensorDescription); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(NodeOutput other) { + if (other == null) { + return; + } + if (other.Slot != 0) { + Slot = other.Slot; + } + if (other.tensorDescription_ != null) { + if (tensorDescription_ == null) { + tensorDescription_ = new global::Tensorflow.TensorDescription(); + } + TensorDescription.MergeFrom(other.TensorDescription); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Slot = input.ReadInt32(); + break; + } + case 26: { + if (tensorDescription_ == null) { + tensorDescription_ = new global::Tensorflow.TensorDescription(); + } + input.ReadMessage(tensorDescription_); + break; + } + } + } + } + + } + + /// + /// For memory tracking. + /// + public sealed partial class MemoryStats : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MemoryStats()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.StepStatsReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryStats() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryStats(MemoryStats other) : this() { + tempMemorySize_ = other.tempMemorySize_; + persistentMemorySize_ = other.persistentMemorySize_; + persistentTensorAllocIds_ = other.persistentTensorAllocIds_.Clone(); + deviceTempMemorySize_ = other.deviceTempMemorySize_; + devicePersistentMemorySize_ = other.devicePersistentMemorySize_; + devicePersistentTensorAllocIds_ = other.devicePersistentTensorAllocIds_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public MemoryStats Clone() { + return new MemoryStats(this); + } + + /// Field number for the "temp_memory_size" field. + public const int TempMemorySizeFieldNumber = 1; + private long tempMemorySize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long TempMemorySize { + get { return tempMemorySize_; } + set { + tempMemorySize_ = value; + } + } + + /// Field number for the "persistent_memory_size" field. + public const int PersistentMemorySizeFieldNumber = 3; + private long persistentMemorySize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long PersistentMemorySize { + get { return persistentMemorySize_; } + set { + persistentMemorySize_ = value; + } + } + + /// Field number for the "persistent_tensor_alloc_ids" field. + public const int PersistentTensorAllocIdsFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_persistentTensorAllocIds_codec + = pb::FieldCodec.ForInt64(42); + private readonly pbc::RepeatedField persistentTensorAllocIds_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField PersistentTensorAllocIds { + get { return persistentTensorAllocIds_; } + } + + /// Field number for the "device_temp_memory_size" field. + public const int DeviceTempMemorySizeFieldNumber = 2; + private long deviceTempMemorySize_; + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long DeviceTempMemorySize { + get { return deviceTempMemorySize_; } + set { + deviceTempMemorySize_ = value; + } + } + + /// Field number for the "device_persistent_memory_size" field. + public const int DevicePersistentMemorySizeFieldNumber = 4; + private long devicePersistentMemorySize_; + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long DevicePersistentMemorySize { + get { return devicePersistentMemorySize_; } + set { + devicePersistentMemorySize_ = value; + } + } + + /// Field number for the "device_persistent_tensor_alloc_ids" field. + public const int DevicePersistentTensorAllocIdsFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_devicePersistentTensorAllocIds_codec + = pb::FieldCodec.ForInt64(50); + private readonly pbc::RepeatedField devicePersistentTensorAllocIds_ = new pbc::RepeatedField(); + [global::System.ObsoleteAttribute] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DevicePersistentTensorAllocIds { + get { return devicePersistentTensorAllocIds_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as MemoryStats); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(MemoryStats other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TempMemorySize != other.TempMemorySize) return false; + if (PersistentMemorySize != other.PersistentMemorySize) return false; + if(!persistentTensorAllocIds_.Equals(other.persistentTensorAllocIds_)) return false; + if (DeviceTempMemorySize != other.DeviceTempMemorySize) return false; + if (DevicePersistentMemorySize != other.DevicePersistentMemorySize) return false; + if(!devicePersistentTensorAllocIds_.Equals(other.devicePersistentTensorAllocIds_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TempMemorySize != 0L) hash ^= TempMemorySize.GetHashCode(); + if (PersistentMemorySize != 0L) hash ^= PersistentMemorySize.GetHashCode(); + hash ^= persistentTensorAllocIds_.GetHashCode(); + if (DeviceTempMemorySize != 0L) hash ^= DeviceTempMemorySize.GetHashCode(); + if (DevicePersistentMemorySize != 0L) hash ^= DevicePersistentMemorySize.GetHashCode(); + hash ^= devicePersistentTensorAllocIds_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (TempMemorySize != 0L) { + output.WriteRawTag(8); + output.WriteInt64(TempMemorySize); + } + if (DeviceTempMemorySize != 0L) { + output.WriteRawTag(16); + output.WriteInt64(DeviceTempMemorySize); + } + if (PersistentMemorySize != 0L) { + output.WriteRawTag(24); + output.WriteInt64(PersistentMemorySize); + } + if (DevicePersistentMemorySize != 0L) { + output.WriteRawTag(32); + output.WriteInt64(DevicePersistentMemorySize); + } + persistentTensorAllocIds_.WriteTo(output, _repeated_persistentTensorAllocIds_codec); + devicePersistentTensorAllocIds_.WriteTo(output, _repeated_devicePersistentTensorAllocIds_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TempMemorySize != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TempMemorySize); + } + if (PersistentMemorySize != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PersistentMemorySize); + } + size += persistentTensorAllocIds_.CalculateSize(_repeated_persistentTensorAllocIds_codec); + if (DeviceTempMemorySize != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(DeviceTempMemorySize); + } + if (DevicePersistentMemorySize != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(DevicePersistentMemorySize); + } + size += devicePersistentTensorAllocIds_.CalculateSize(_repeated_devicePersistentTensorAllocIds_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(MemoryStats other) { + if (other == null) { + return; + } + if (other.TempMemorySize != 0L) { + TempMemorySize = other.TempMemorySize; + } + if (other.PersistentMemorySize != 0L) { + PersistentMemorySize = other.PersistentMemorySize; + } + persistentTensorAllocIds_.Add(other.persistentTensorAllocIds_); + if (other.DeviceTempMemorySize != 0L) { + DeviceTempMemorySize = other.DeviceTempMemorySize; + } + if (other.DevicePersistentMemorySize != 0L) { + DevicePersistentMemorySize = other.DevicePersistentMemorySize; + } + devicePersistentTensorAllocIds_.Add(other.devicePersistentTensorAllocIds_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TempMemorySize = input.ReadInt64(); + break; + } + case 16: { + DeviceTempMemorySize = input.ReadInt64(); + break; + } + case 24: { + PersistentMemorySize = input.ReadInt64(); + break; + } + case 32: { + DevicePersistentMemorySize = input.ReadInt64(); + break; + } + case 42: + case 40: { + persistentTensorAllocIds_.AddEntriesFrom(input, _repeated_persistentTensorAllocIds_codec); + break; + } + case 50: + case 48: { + devicePersistentTensorAllocIds_.AddEntriesFrom(input, _repeated_devicePersistentTensorAllocIds_codec); + break; + } + } + } + } + + } + + /// + /// Time/size stats recorded for a single execution of a graph node. + /// + public sealed partial class NodeExecStats : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NodeExecStats()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.StepStatsReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NodeExecStats() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NodeExecStats(NodeExecStats other) : this() { + nodeName_ = other.nodeName_; + allStartMicros_ = other.allStartMicros_; + opStartRelMicros_ = other.opStartRelMicros_; + opEndRelMicros_ = other.opEndRelMicros_; + allEndRelMicros_ = other.allEndRelMicros_; + memory_ = other.memory_.Clone(); + output_ = other.output_.Clone(); + timelineLabel_ = other.timelineLabel_; + scheduledMicros_ = other.scheduledMicros_; + threadId_ = other.threadId_; + referencedTensor_ = other.referencedTensor_.Clone(); + memoryStats_ = other.memoryStats_ != null ? other.memoryStats_.Clone() : null; + allStartNanos_ = other.allStartNanos_; + opStartRelNanos_ = other.opStartRelNanos_; + opEndRelNanos_ = other.opEndRelNanos_; + allEndRelNanos_ = other.allEndRelNanos_; + scheduledNanos_ = other.scheduledNanos_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NodeExecStats Clone() { + return new NodeExecStats(this); + } + + /// Field number for the "node_name" field. + public const int NodeNameFieldNumber = 1; + private string nodeName_ = ""; + /// + /// TODO(tucker): Use some more compact form of node identity than + /// the full string name. Either all processes should agree on a + /// global id (cost_id?) for each node, or we should use a hash of + /// the name. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string NodeName { + get { return nodeName_; } + set { + nodeName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "all_start_micros" field. + public const int AllStartMicrosFieldNumber = 2; + private long allStartMicros_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllStartMicros { + get { return allStartMicros_; } + set { + allStartMicros_ = value; + } + } + + /// Field number for the "op_start_rel_micros" field. + public const int OpStartRelMicrosFieldNumber = 3; + private long opStartRelMicros_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long OpStartRelMicros { + get { return opStartRelMicros_; } + set { + opStartRelMicros_ = value; + } + } + + /// Field number for the "op_end_rel_micros" field. + public const int OpEndRelMicrosFieldNumber = 4; + private long opEndRelMicros_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long OpEndRelMicros { + get { return opEndRelMicros_; } + set { + opEndRelMicros_ = value; + } + } + + /// Field number for the "all_end_rel_micros" field. + public const int AllEndRelMicrosFieldNumber = 5; + private long allEndRelMicros_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllEndRelMicros { + get { return allEndRelMicros_; } + set { + allEndRelMicros_ = value; + } + } + + /// Field number for the "memory" field. + public const int MemoryFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_memory_codec + = pb::FieldCodec.ForMessage(50, global::Tensorflow.AllocatorMemoryUsed.Parser); + private readonly pbc::RepeatedField memory_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Memory { + get { return memory_; } + } + + /// Field number for the "output" field. + public const int OutputFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_output_codec + = pb::FieldCodec.ForMessage(58, global::Tensorflow.NodeOutput.Parser); + private readonly pbc::RepeatedField output_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Output { + get { return output_; } + } + + /// Field number for the "timeline_label" field. + public const int TimelineLabelFieldNumber = 8; + private string timelineLabel_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string TimelineLabel { + get { return timelineLabel_; } + set { + timelineLabel_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "scheduled_micros" field. + public const int ScheduledMicrosFieldNumber = 9; + private long scheduledMicros_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long ScheduledMicros { + get { return scheduledMicros_; } + set { + scheduledMicros_ = value; + } + } + + /// Field number for the "thread_id" field. + public const int ThreadIdFieldNumber = 10; + private uint threadId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint ThreadId { + get { return threadId_; } + set { + threadId_ = value; + } + } + + /// Field number for the "referenced_tensor" field. + public const int ReferencedTensorFieldNumber = 11; + private static readonly pb::FieldCodec _repeated_referencedTensor_codec + = pb::FieldCodec.ForMessage(90, global::Tensorflow.AllocationDescription.Parser); + private readonly pbc::RepeatedField referencedTensor_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ReferencedTensor { + get { return referencedTensor_; } + } + + /// Field number for the "memory_stats" field. + public const int MemoryStatsFieldNumber = 12; + private global::Tensorflow.MemoryStats memoryStats_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.MemoryStats MemoryStats { + get { return memoryStats_; } + set { + memoryStats_ = value; + } + } + + /// Field number for the "all_start_nanos" field. + public const int AllStartNanosFieldNumber = 13; + private long allStartNanos_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllStartNanos { + get { return allStartNanos_; } + set { + allStartNanos_ = value; + } + } + + /// Field number for the "op_start_rel_nanos" field. + public const int OpStartRelNanosFieldNumber = 14; + private long opStartRelNanos_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long OpStartRelNanos { + get { return opStartRelNanos_; } + set { + opStartRelNanos_ = value; + } + } + + /// Field number for the "op_end_rel_nanos" field. + public const int OpEndRelNanosFieldNumber = 15; + private long opEndRelNanos_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long OpEndRelNanos { + get { return opEndRelNanos_; } + set { + opEndRelNanos_ = value; + } + } + + /// Field number for the "all_end_rel_nanos" field. + public const int AllEndRelNanosFieldNumber = 16; + private long allEndRelNanos_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long AllEndRelNanos { + get { return allEndRelNanos_; } + set { + allEndRelNanos_ = value; + } + } + + /// Field number for the "scheduled_nanos" field. + public const int ScheduledNanosFieldNumber = 17; + private long scheduledNanos_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long ScheduledNanos { + get { return scheduledNanos_; } + set { + scheduledNanos_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as NodeExecStats); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(NodeExecStats other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NodeName != other.NodeName) return false; + if (AllStartMicros != other.AllStartMicros) return false; + if (OpStartRelMicros != other.OpStartRelMicros) return false; + if (OpEndRelMicros != other.OpEndRelMicros) return false; + if (AllEndRelMicros != other.AllEndRelMicros) return false; + if(!memory_.Equals(other.memory_)) return false; + if(!output_.Equals(other.output_)) return false; + if (TimelineLabel != other.TimelineLabel) return false; + if (ScheduledMicros != other.ScheduledMicros) return false; + if (ThreadId != other.ThreadId) return false; + if(!referencedTensor_.Equals(other.referencedTensor_)) return false; + if (!object.Equals(MemoryStats, other.MemoryStats)) return false; + if (AllStartNanos != other.AllStartNanos) return false; + if (OpStartRelNanos != other.OpStartRelNanos) return false; + if (OpEndRelNanos != other.OpEndRelNanos) return false; + if (AllEndRelNanos != other.AllEndRelNanos) return false; + if (ScheduledNanos != other.ScheduledNanos) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (NodeName.Length != 0) hash ^= NodeName.GetHashCode(); + if (AllStartMicros != 0L) hash ^= AllStartMicros.GetHashCode(); + if (OpStartRelMicros != 0L) hash ^= OpStartRelMicros.GetHashCode(); + if (OpEndRelMicros != 0L) hash ^= OpEndRelMicros.GetHashCode(); + if (AllEndRelMicros != 0L) hash ^= AllEndRelMicros.GetHashCode(); + hash ^= memory_.GetHashCode(); + hash ^= output_.GetHashCode(); + if (TimelineLabel.Length != 0) hash ^= TimelineLabel.GetHashCode(); + if (ScheduledMicros != 0L) hash ^= ScheduledMicros.GetHashCode(); + if (ThreadId != 0) hash ^= ThreadId.GetHashCode(); + hash ^= referencedTensor_.GetHashCode(); + if (memoryStats_ != null) hash ^= MemoryStats.GetHashCode(); + if (AllStartNanos != 0L) hash ^= AllStartNanos.GetHashCode(); + if (OpStartRelNanos != 0L) hash ^= OpStartRelNanos.GetHashCode(); + if (OpEndRelNanos != 0L) hash ^= OpEndRelNanos.GetHashCode(); + if (AllEndRelNanos != 0L) hash ^= AllEndRelNanos.GetHashCode(); + if (ScheduledNanos != 0L) hash ^= ScheduledNanos.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (NodeName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(NodeName); + } + if (AllStartMicros != 0L) { + output.WriteRawTag(16); + output.WriteInt64(AllStartMicros); + } + if (OpStartRelMicros != 0L) { + output.WriteRawTag(24); + output.WriteInt64(OpStartRelMicros); + } + if (OpEndRelMicros != 0L) { + output.WriteRawTag(32); + output.WriteInt64(OpEndRelMicros); + } + if (AllEndRelMicros != 0L) { + output.WriteRawTag(40); + output.WriteInt64(AllEndRelMicros); + } + memory_.WriteTo(output, _repeated_memory_codec); + output_.WriteTo(output, _repeated_output_codec); + if (TimelineLabel.Length != 0) { + output.WriteRawTag(66); + output.WriteString(TimelineLabel); + } + if (ScheduledMicros != 0L) { + output.WriteRawTag(72); + output.WriteInt64(ScheduledMicros); + } + if (ThreadId != 0) { + output.WriteRawTag(80); + output.WriteUInt32(ThreadId); + } + referencedTensor_.WriteTo(output, _repeated_referencedTensor_codec); + if (memoryStats_ != null) { + output.WriteRawTag(98); + output.WriteMessage(MemoryStats); + } + if (AllStartNanos != 0L) { + output.WriteRawTag(104); + output.WriteInt64(AllStartNanos); + } + if (OpStartRelNanos != 0L) { + output.WriteRawTag(112); + output.WriteInt64(OpStartRelNanos); + } + if (OpEndRelNanos != 0L) { + output.WriteRawTag(120); + output.WriteInt64(OpEndRelNanos); + } + if (AllEndRelNanos != 0L) { + output.WriteRawTag(128, 1); + output.WriteInt64(AllEndRelNanos); + } + if (ScheduledNanos != 0L) { + output.WriteRawTag(136, 1); + output.WriteInt64(ScheduledNanos); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (NodeName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(NodeName); + } + if (AllStartMicros != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllStartMicros); + } + if (OpStartRelMicros != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(OpStartRelMicros); + } + if (OpEndRelMicros != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(OpEndRelMicros); + } + if (AllEndRelMicros != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllEndRelMicros); + } + size += memory_.CalculateSize(_repeated_memory_codec); + size += output_.CalculateSize(_repeated_output_codec); + if (TimelineLabel.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TimelineLabel); + } + if (ScheduledMicros != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(ScheduledMicros); + } + if (ThreadId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ThreadId); + } + size += referencedTensor_.CalculateSize(_repeated_referencedTensor_codec); + if (memoryStats_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(MemoryStats); + } + if (AllStartNanos != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllStartNanos); + } + if (OpStartRelNanos != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(OpStartRelNanos); + } + if (OpEndRelNanos != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(OpEndRelNanos); + } + if (AllEndRelNanos != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(AllEndRelNanos); + } + if (ScheduledNanos != 0L) { + size += 2 + pb::CodedOutputStream.ComputeInt64Size(ScheduledNanos); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(NodeExecStats other) { + if (other == null) { + return; + } + if (other.NodeName.Length != 0) { + NodeName = other.NodeName; + } + if (other.AllStartMicros != 0L) { + AllStartMicros = other.AllStartMicros; + } + if (other.OpStartRelMicros != 0L) { + OpStartRelMicros = other.OpStartRelMicros; + } + if (other.OpEndRelMicros != 0L) { + OpEndRelMicros = other.OpEndRelMicros; + } + if (other.AllEndRelMicros != 0L) { + AllEndRelMicros = other.AllEndRelMicros; + } + memory_.Add(other.memory_); + output_.Add(other.output_); + if (other.TimelineLabel.Length != 0) { + TimelineLabel = other.TimelineLabel; + } + if (other.ScheduledMicros != 0L) { + ScheduledMicros = other.ScheduledMicros; + } + if (other.ThreadId != 0) { + ThreadId = other.ThreadId; + } + referencedTensor_.Add(other.referencedTensor_); + if (other.memoryStats_ != null) { + if (memoryStats_ == null) { + memoryStats_ = new global::Tensorflow.MemoryStats(); + } + MemoryStats.MergeFrom(other.MemoryStats); + } + if (other.AllStartNanos != 0L) { + AllStartNanos = other.AllStartNanos; + } + if (other.OpStartRelNanos != 0L) { + OpStartRelNanos = other.OpStartRelNanos; + } + if (other.OpEndRelNanos != 0L) { + OpEndRelNanos = other.OpEndRelNanos; + } + if (other.AllEndRelNanos != 0L) { + AllEndRelNanos = other.AllEndRelNanos; + } + if (other.ScheduledNanos != 0L) { + ScheduledNanos = other.ScheduledNanos; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + NodeName = input.ReadString(); + break; + } + case 16: { + AllStartMicros = input.ReadInt64(); + break; + } + case 24: { + OpStartRelMicros = input.ReadInt64(); + break; + } + case 32: { + OpEndRelMicros = input.ReadInt64(); + break; + } + case 40: { + AllEndRelMicros = input.ReadInt64(); + break; + } + case 50: { + memory_.AddEntriesFrom(input, _repeated_memory_codec); + break; + } + case 58: { + output_.AddEntriesFrom(input, _repeated_output_codec); + break; + } + case 66: { + TimelineLabel = input.ReadString(); + break; + } + case 72: { + ScheduledMicros = input.ReadInt64(); + break; + } + case 80: { + ThreadId = input.ReadUInt32(); + break; + } + case 90: { + referencedTensor_.AddEntriesFrom(input, _repeated_referencedTensor_codec); + break; + } + case 98: { + if (memoryStats_ == null) { + memoryStats_ = new global::Tensorflow.MemoryStats(); + } + input.ReadMessage(memoryStats_); + break; + } + case 104: { + AllStartNanos = input.ReadInt64(); + break; + } + case 112: { + OpStartRelNanos = input.ReadInt64(); + break; + } + case 120: { + OpEndRelNanos = input.ReadInt64(); + break; + } + case 128: { + AllEndRelNanos = input.ReadInt64(); + break; + } + case 136: { + ScheduledNanos = input.ReadInt64(); + break; + } + } + } + } + + } + + public sealed partial class DeviceStepStats : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeviceStepStats()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.StepStatsReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DeviceStepStats() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DeviceStepStats(DeviceStepStats other) : this() { + device_ = other.device_; + nodeStats_ = other.nodeStats_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public DeviceStepStats Clone() { + return new DeviceStepStats(this); + } + + /// Field number for the "device" field. + public const int DeviceFieldNumber = 1; + private string device_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Device { + get { return device_; } + set { + device_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "node_stats" field. + public const int NodeStatsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_nodeStats_codec + = pb::FieldCodec.ForMessage(18, global::Tensorflow.NodeExecStats.Parser); + private readonly pbc::RepeatedField nodeStats_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField NodeStats { + get { return nodeStats_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as DeviceStepStats); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(DeviceStepStats other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Device != other.Device) return false; + if(!nodeStats_.Equals(other.nodeStats_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Device.Length != 0) hash ^= Device.GetHashCode(); + hash ^= nodeStats_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Device.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Device); + } + nodeStats_.WriteTo(output, _repeated_nodeStats_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Device.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Device); + } + size += nodeStats_.CalculateSize(_repeated_nodeStats_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(DeviceStepStats other) { + if (other == null) { + return; + } + if (other.Device.Length != 0) { + Device = other.Device; + } + nodeStats_.Add(other.nodeStats_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Device = input.ReadString(); + break; + } + case 18: { + nodeStats_.AddEntriesFrom(input, _repeated_nodeStats_codec); + break; + } + } + } + } + + } + + public sealed partial class StepStats : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StepStats()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.StepStatsReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StepStats() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StepStats(StepStats other) : this() { + devStats_ = other.devStats_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StepStats Clone() { + return new StepStats(this); + } + + /// Field number for the "dev_stats" field. + public const int DevStatsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_devStats_codec + = pb::FieldCodec.ForMessage(10, global::Tensorflow.DeviceStepStats.Parser); + private readonly pbc::RepeatedField devStats_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField DevStats { + get { return devStats_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StepStats); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StepStats other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!devStats_.Equals(other.devStats_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= devStats_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + devStats_.WriteTo(output, _repeated_devStats_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += devStats_.CalculateSize(_repeated_devStats_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StepStats other) { + if (other == null) { + return; + } + devStats_.Add(other.devStats_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + devStats_.AddEntriesFrom(input, _repeated_devStats_codec); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/Tensor.cs b/src/TensorFlowNET.Core/Protobuf/Tensor.cs index 1f333300..daef3e19 100644 --- a/src/TensorFlowNET.Core/Protobuf/Tensor.cs +++ b/src/TensorFlowNET.Core/Protobuf/Tensor.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensor.proto +// source: tensorflow/core/framework/tensor.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Tensorflow { - /// Holder for reflection information generated from tensor.proto + /// Holder for reflection information generated from tensorflow/core/framework/tensor.proto public static partial class TensorReflection { #region Descriptor - /// File descriptor for tensor.proto + /// File descriptor for tensorflow/core/framework/tensor.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,25 +24,27 @@ namespace Tensorflow { static TensorReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cgx0ZW5zb3IucHJvdG8SCnRlbnNvcmZsb3caFXJlc291cmNlX2hhbmRsZS5w", - "cm90bxoSdGVuc29yX3NoYXBlLnByb3RvGgt0eXBlcy5wcm90byKMBAoLVGVu", - "c29yUHJvdG8SIwoFZHR5cGUYASABKA4yFC50ZW5zb3JmbG93LkRhdGFUeXBl", - "EjIKDHRlbnNvcl9zaGFwZRgCIAEoCzIcLnRlbnNvcmZsb3cuVGVuc29yU2hh", - "cGVQcm90bxIWCg52ZXJzaW9uX251bWJlchgDIAEoBRIWCg50ZW5zb3JfY29u", - "dGVudBgEIAEoDBIUCghoYWxmX3ZhbBgNIAMoBUICEAESFQoJZmxvYXRfdmFs", - "GAUgAygCQgIQARIWCgpkb3VibGVfdmFsGAYgAygBQgIQARITCgdpbnRfdmFs", - "GAcgAygFQgIQARISCgpzdHJpbmdfdmFsGAggAygMEhgKDHNjb21wbGV4X3Zh", - "bBgJIAMoAkICEAESFQoJaW50NjRfdmFsGAogAygDQgIQARIUCghib29sX3Zh", - "bBgLIAMoCEICEAESGAoMZGNvbXBsZXhfdmFsGAwgAygBQgIQARI8ChNyZXNv", - "dXJjZV9oYW5kbGVfdmFsGA4gAygLMh8udGVuc29yZmxvdy5SZXNvdXJjZUhh", - "bmRsZVByb3RvEjcKC3ZhcmlhbnRfdmFsGA8gAygLMiIudGVuc29yZmxvdy5W", - "YXJpYW50VGVuc29yRGF0YVByb3RvEhYKCnVpbnQzMl92YWwYECADKA1CAhAB", - "EhYKCnVpbnQ2NF92YWwYESADKARCAhABImcKFlZhcmlhbnRUZW5zb3JEYXRh", - "UHJvdG8SEQoJdHlwZV9uYW1lGAEgASgJEhAKCG1ldGFkYXRhGAIgASgMEigK", - "B3RlbnNvcnMYAyADKAsyFy50ZW5zb3JmbG93LlRlbnNvclByb3RvQmwKGG9y", - "Zy50ZW5zb3JmbG93LmZyYW1ld29ya0IMVGVuc29yUHJvdG9zUAFaPWdpdGh1", - "Yi5jb20vdGVuc29yZmxvdy90ZW5zb3JmbG93L3RlbnNvcmZsb3cvZ28vY29y", - "ZS9mcmFtZXdvcmv4AQFiBnByb3RvMw==")); + "CiZ0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNvci5wcm90bxIKdGVu", + "c29yZmxvdxovdGVuc29yZmxvdy9jb3JlL2ZyYW1ld29yay9yZXNvdXJjZV9o", + "YW5kbGUucHJvdG8aLHRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvdGVuc29y", + "X3NoYXBlLnByb3RvGiV0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3R5cGVz", + "LnByb3RvIowECgtUZW5zb3JQcm90bxIjCgVkdHlwZRgBIAEoDjIULnRlbnNv", + "cmZsb3cuRGF0YVR5cGUSMgoMdGVuc29yX3NoYXBlGAIgASgLMhwudGVuc29y", + "Zmxvdy5UZW5zb3JTaGFwZVByb3RvEhYKDnZlcnNpb25fbnVtYmVyGAMgASgF", + "EhYKDnRlbnNvcl9jb250ZW50GAQgASgMEhQKCGhhbGZfdmFsGA0gAygFQgIQ", + "ARIVCglmbG9hdF92YWwYBSADKAJCAhABEhYKCmRvdWJsZV92YWwYBiADKAFC", + "AhABEhMKB2ludF92YWwYByADKAVCAhABEhIKCnN0cmluZ192YWwYCCADKAwS", + "GAoMc2NvbXBsZXhfdmFsGAkgAygCQgIQARIVCglpbnQ2NF92YWwYCiADKANC", + "AhABEhQKCGJvb2xfdmFsGAsgAygIQgIQARIYCgxkY29tcGxleF92YWwYDCAD", + "KAFCAhABEjwKE3Jlc291cmNlX2hhbmRsZV92YWwYDiADKAsyHy50ZW5zb3Jm", + "bG93LlJlc291cmNlSGFuZGxlUHJvdG8SNwoLdmFyaWFudF92YWwYDyADKAsy", + "Ii50ZW5zb3JmbG93LlZhcmlhbnRUZW5zb3JEYXRhUHJvdG8SFgoKdWludDMy", + "X3ZhbBgQIAMoDUICEAESFgoKdWludDY0X3ZhbBgRIAMoBEICEAEiZwoWVmFy", + "aWFudFRlbnNvckRhdGFQcm90bxIRCgl0eXBlX25hbWUYASABKAkSEAoIbWV0", + "YWRhdGEYAiABKAwSKAoHdGVuc29ycxgDIAMoCzIXLnRlbnNvcmZsb3cuVGVu", + "c29yUHJvdG9CbAoYb3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQgxUZW5zb3JQ", + "cm90b3NQAVo9Z2l0aHViLmNvbS90ZW5zb3JmbG93L3RlbnNvcmZsb3cvdGVu", + "c29yZmxvdy9nby9jb3JlL2ZyYW1ld29ya/gBAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tensorflow.ResourceHandleReflection.Descriptor, global::Tensorflow.TensorShapeReflection.Descriptor, global::Tensorflow.TypesReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { diff --git a/src/TensorFlowNET.Core/Protobuf/TensorDescription.cs b/src/TensorFlowNET.Core/Protobuf/TensorDescription.cs new file mode 100644 index 00000000..4acb848b --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/TensorDescription.cs @@ -0,0 +1,259 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/tensor_description.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/tensor_description.proto + public static partial class TensorDescriptionReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/tensor_description.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TensorDescriptionReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CjJ0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNvcl9kZXNjcmlwdGlv", + "bi5wcm90bxIKdGVuc29yZmxvdxoldGVuc29yZmxvdy9jb3JlL2ZyYW1ld29y", + "ay90eXBlcy5wcm90bxosdGVuc29yZmxvdy9jb3JlL2ZyYW1ld29yay90ZW5z", + "b3Jfc2hhcGUucHJvdG8aNnRlbnNvcmZsb3cvY29yZS9mcmFtZXdvcmsvYWxs", + "b2NhdGlvbl9kZXNjcmlwdGlvbi5wcm90byKoAQoRVGVuc29yRGVzY3JpcHRp", + "b24SIwoFZHR5cGUYASABKA4yFC50ZW5zb3JmbG93LkRhdGFUeXBlEisKBXNo", + "YXBlGAIgASgLMhwudGVuc29yZmxvdy5UZW5zb3JTaGFwZVByb3RvEkEKFmFs", + "bG9jYXRpb25fZGVzY3JpcHRpb24YBCABKAsyIS50ZW5zb3JmbG93LkFsbG9j", + "YXRpb25EZXNjcmlwdGlvbkJ3ChhvcmcudGVuc29yZmxvdy5mcmFtZXdvcmtC", + "F1RlbnNvckRlc2NyaXB0aW9uUHJvdG9zUAFaPWdpdGh1Yi5jb20vdGVuc29y", + "Zmxvdy90ZW5zb3JmbG93L3RlbnNvcmZsb3cvZ28vY29yZS9mcmFtZXdvcmv4", + "AQFiBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tensorflow.TypesReflection.Descriptor, global::Tensorflow.TensorShapeReflection.Descriptor, global::Tensorflow.AllocationDescriptionReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.TensorDescription), global::Tensorflow.TensorDescription.Parser, new[]{ "Dtype", "Shape", "AllocationDescription" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class TensorDescription : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorDescription()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.TensorDescriptionReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TensorDescription() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TensorDescription(TensorDescription other) : this() { + dtype_ = other.dtype_; + shape_ = other.shape_ != null ? other.shape_.Clone() : null; + allocationDescription_ = other.allocationDescription_ != null ? other.allocationDescription_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TensorDescription Clone() { + return new TensorDescription(this); + } + + /// Field number for the "dtype" field. + public const int DtypeFieldNumber = 1; + private global::Tensorflow.DataType dtype_ = 0; + /// + /// Data type of tensor elements + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.DataType Dtype { + get { return dtype_; } + set { + dtype_ = value; + } + } + + /// Field number for the "shape" field. + public const int ShapeFieldNumber = 2; + private global::Tensorflow.TensorShapeProto shape_; + /// + /// Shape of the tensor. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.TensorShapeProto Shape { + get { return shape_; } + set { + shape_ = value; + } + } + + /// Field number for the "allocation_description" field. + public const int AllocationDescriptionFieldNumber = 4; + private global::Tensorflow.AllocationDescription allocationDescription_; + /// + /// Information about the size and allocator used for the data + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tensorflow.AllocationDescription AllocationDescription { + get { return allocationDescription_; } + set { + allocationDescription_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TensorDescription); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TensorDescription other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Dtype != other.Dtype) return false; + if (!object.Equals(Shape, other.Shape)) return false; + if (!object.Equals(AllocationDescription, other.AllocationDescription)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Dtype != 0) hash ^= Dtype.GetHashCode(); + if (shape_ != null) hash ^= Shape.GetHashCode(); + if (allocationDescription_ != null) hash ^= AllocationDescription.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Dtype != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Dtype); + } + if (shape_ != null) { + output.WriteRawTag(18); + output.WriteMessage(Shape); + } + if (allocationDescription_ != null) { + output.WriteRawTag(34); + output.WriteMessage(AllocationDescription); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Dtype != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Dtype); + } + if (shape_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Shape); + } + if (allocationDescription_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(AllocationDescription); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TensorDescription other) { + if (other == null) { + return; + } + if (other.Dtype != 0) { + Dtype = other.Dtype; + } + if (other.shape_ != null) { + if (shape_ == null) { + shape_ = new global::Tensorflow.TensorShapeProto(); + } + Shape.MergeFrom(other.Shape); + } + if (other.allocationDescription_ != null) { + if (allocationDescription_ == null) { + allocationDescription_ = new global::Tensorflow.AllocationDescription(); + } + AllocationDescription.MergeFrom(other.AllocationDescription); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + dtype_ = (global::Tensorflow.DataType) input.ReadEnum(); + break; + } + case 18: { + if (shape_ == null) { + shape_ = new global::Tensorflow.TensorShapeProto(); + } + input.ReadMessage(shape_); + break; + } + case 34: { + if (allocationDescription_ == null) { + allocationDescription_ = new global::Tensorflow.AllocationDescription(); + } + input.ReadMessage(allocationDescription_); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/TensorSlice.cs b/src/TensorFlowNET.Core/Protobuf/TensorSlice.cs new file mode 100644 index 00000000..8efa1216 --- /dev/null +++ b/src/TensorFlowNET.Core/Protobuf/TensorSlice.cs @@ -0,0 +1,377 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: tensorflow/core/framework/tensor_slice.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tensorflow { + + /// Holder for reflection information generated from tensorflow/core/framework/tensor_slice.proto + public static partial class TensorSliceReflection { + + #region Descriptor + /// File descriptor for tensorflow/core/framework/tensor_slice.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static TensorSliceReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cix0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3RlbnNvcl9zbGljZS5wcm90", + "bxIKdGVuc29yZmxvdyKAAQoQVGVuc29yU2xpY2VQcm90bxIzCgZleHRlbnQY", + "ASADKAsyIy50ZW5zb3JmbG93LlRlbnNvclNsaWNlUHJvdG8uRXh0ZW50GjcK", + "BkV4dGVudBINCgVzdGFydBgBIAEoAxIQCgZsZW5ndGgYAiABKANIAEIMCgpo", + "YXNfbGVuZ3RoQnEKGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IRVGVuc29y", + "U2xpY2VQcm90b3NQAVo9Z2l0aHViLmNvbS90ZW5zb3JmbG93L3RlbnNvcmZs", + "b3cvdGVuc29yZmxvdy9nby9jb3JlL2ZyYW1ld29ya/gBAWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.TensorSliceProto), global::Tensorflow.TensorSliceProto.Parser, new[]{ "Extent" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.TensorSliceProto.Types.Extent), global::Tensorflow.TensorSliceProto.Types.Extent.Parser, new[]{ "Start", "Length" }, new[]{ "HasLength" }, null, null)}) + })); + } + #endregion + + } + #region Messages + /// + /// Can only be interpreted if you know the corresponding TensorShape. + /// + public sealed partial class TensorSliceProto : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorSliceProto()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.TensorSliceReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TensorSliceProto() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TensorSliceProto(TensorSliceProto other) : this() { + extent_ = other.extent_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public TensorSliceProto Clone() { + return new TensorSliceProto(this); + } + + /// Field number for the "extent" field. + public const int ExtentFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_extent_codec + = pb::FieldCodec.ForMessage(10, global::Tensorflow.TensorSliceProto.Types.Extent.Parser); + private readonly pbc::RepeatedField extent_ = new pbc::RepeatedField(); + /// + /// Extent of the slice in all tensor dimensions. + /// + /// Must have one entry for each of the dimension of the tensor that this + /// slice belongs to. The order of sizes is the same as the order of + /// dimensions in the TensorShape. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Extent { + get { return extent_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as TensorSliceProto); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(TensorSliceProto other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!extent_.Equals(other.extent_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= extent_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + extent_.WriteTo(output, _repeated_extent_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += extent_.CalculateSize(_repeated_extent_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(TensorSliceProto other) { + if (other == null) { + return; + } + extent_.Add(other.extent_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + extent_.AddEntriesFrom(input, _repeated_extent_codec); + break; + } + } + } + } + + #region Nested types + /// Container for nested types declared in the TensorSliceProto message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static partial class Types { + /// + /// Extent of the slice in one dimension. + /// + public sealed partial class Extent : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Extent()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tensorflow.TensorSliceProto.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Extent() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Extent(Extent other) : this() { + start_ = other.start_; + switch (other.HasLengthCase) { + case HasLengthOneofCase.Length: + Length = other.Length; + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Extent Clone() { + return new Extent(this); + } + + /// Field number for the "start" field. + public const int StartFieldNumber = 1; + private long start_; + /// + /// Start index of the slice, starting at 0. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Start { + get { return start_; } + set { + start_ = value; + } + } + + /// Field number for the "length" field. + public const int LengthFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long Length { + get { return hasLengthCase_ == HasLengthOneofCase.Length ? (long) hasLength_ : 0L; } + set { + hasLength_ = value; + hasLengthCase_ = HasLengthOneofCase.Length; + } + } + + private object hasLength_; + /// Enum of possible cases for the "has_length" oneof. + public enum HasLengthOneofCase { + None = 0, + Length = 2, + } + private HasLengthOneofCase hasLengthCase_ = HasLengthOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public HasLengthOneofCase HasLengthCase { + get { return hasLengthCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearHasLength() { + hasLengthCase_ = HasLengthOneofCase.None; + hasLength_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Extent); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Extent other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Start != other.Start) return false; + if (Length != other.Length) return false; + if (HasLengthCase != other.HasLengthCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Start != 0L) hash ^= Start.GetHashCode(); + if (hasLengthCase_ == HasLengthOneofCase.Length) hash ^= Length.GetHashCode(); + hash ^= (int) hasLengthCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Start != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Start); + } + if (hasLengthCase_ == HasLengthOneofCase.Length) { + output.WriteRawTag(16); + output.WriteInt64(Length); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Start != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Start); + } + if (hasLengthCase_ == HasLengthOneofCase.Length) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Length); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Extent other) { + if (other == null) { + return; + } + if (other.Start != 0L) { + Start = other.Start; + } + switch (other.HasLengthCase) { + case HasLengthOneofCase.Length: + Length = other.Length; + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Start = input.ReadInt64(); + break; + } + case 16: { + Length = input.ReadInt64(); + break; + } + } + } + } + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/TensorFlowNET.Core/Protobuf/Types.cs b/src/TensorFlowNET.Core/Protobuf/Types.cs index 887ff322..095635d2 100644 --- a/src/TensorFlowNET.Core/Protobuf/Types.cs +++ b/src/TensorFlowNET.Core/Protobuf/Types.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: types.proto +// source: tensorflow/core/framework/types.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Tensorflow { - /// Holder for reflection information generated from types.proto + /// Holder for reflection information generated from tensorflow/core/framework/types.proto public static partial class TypesReflection { #region Descriptor - /// File descriptor for types.proto + /// File descriptor for tensorflow/core/framework/types.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,28 +24,28 @@ namespace Tensorflow { static TypesReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cgt0eXBlcy5wcm90bxIKdGVuc29yZmxvdyqqBgoIRGF0YVR5cGUSDgoKRFRf", - "SU5WQUxJRBAAEgwKCERUX0ZMT0FUEAESDQoJRFRfRE9VQkxFEAISDAoIRFRf", - "SU5UMzIQAxIMCghEVF9VSU5UOBAEEgwKCERUX0lOVDE2EAUSCwoHRFRfSU5U", - "OBAGEg0KCURUX1NUUklORxAHEhAKDERUX0NPTVBMRVg2NBAIEgwKCERUX0lO", - "VDY0EAkSCwoHRFRfQk9PTBAKEgwKCERUX1FJTlQ4EAsSDQoJRFRfUVVJTlQ4", - "EAwSDQoJRFRfUUlOVDMyEA0SDwoLRFRfQkZMT0FUMTYQDhINCglEVF9RSU5U", - "MTYQDxIOCgpEVF9RVUlOVDE2EBASDQoJRFRfVUlOVDE2EBESEQoNRFRfQ09N", - "UExFWDEyOBASEgsKB0RUX0hBTEYQExIPCgtEVF9SRVNPVVJDRRAUEg4KCkRU", - "X1ZBUklBTlQQFRINCglEVF9VSU5UMzIQFhINCglEVF9VSU5UNjQQFxIQCgxE", - "VF9GTE9BVF9SRUYQZRIRCg1EVF9ET1VCTEVfUkVGEGYSEAoMRFRfSU5UMzJf", - "UkVGEGcSEAoMRFRfVUlOVDhfUkVGEGgSEAoMRFRfSU5UMTZfUkVGEGkSDwoL", - "RFRfSU5UOF9SRUYQahIRCg1EVF9TVFJJTkdfUkVGEGsSFAoQRFRfQ09NUExF", - "WDY0X1JFRhBsEhAKDERUX0lOVDY0X1JFRhBtEg8KC0RUX0JPT0xfUkVGEG4S", - "EAoMRFRfUUlOVDhfUkVGEG8SEQoNRFRfUVVJTlQ4X1JFRhBwEhEKDURUX1FJ", - "TlQzMl9SRUYQcRITCg9EVF9CRkxPQVQxNl9SRUYQchIRCg1EVF9RSU5UMTZf", - "UkVGEHMSEgoORFRfUVVJTlQxNl9SRUYQdBIRCg1EVF9VSU5UMTZfUkVGEHUS", - "FQoRRFRfQ09NUExFWDEyOF9SRUYQdhIPCgtEVF9IQUxGX1JFRhB3EhMKD0RU", - "X1JFU09VUkNFX1JFRhB4EhIKDkRUX1ZBUklBTlRfUkVGEHkSEQoNRFRfVUlO", - "VDMyX1JFRhB6EhEKDURUX1VJTlQ2NF9SRUYQe0JrChhvcmcudGVuc29yZmxv", - "dy5mcmFtZXdvcmtCC1R5cGVzUHJvdG9zUAFaPWdpdGh1Yi5jb20vdGVuc29y", - "Zmxvdy90ZW5zb3JmbG93L3RlbnNvcmZsb3cvZ28vY29yZS9mcmFtZXdvcmv4", - "AQFiBnByb3RvMw==")); + "CiV0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3R5cGVzLnByb3RvEgp0ZW5z", + "b3JmbG93KqoGCghEYXRhVHlwZRIOCgpEVF9JTlZBTElEEAASDAoIRFRfRkxP", + "QVQQARINCglEVF9ET1VCTEUQAhIMCghEVF9JTlQzMhADEgwKCERUX1VJTlQ4", + "EAQSDAoIRFRfSU5UMTYQBRILCgdEVF9JTlQ4EAYSDQoJRFRfU1RSSU5HEAcS", + "EAoMRFRfQ09NUExFWDY0EAgSDAoIRFRfSU5UNjQQCRILCgdEVF9CT09MEAoS", + "DAoIRFRfUUlOVDgQCxINCglEVF9RVUlOVDgQDBINCglEVF9RSU5UMzIQDRIP", + "CgtEVF9CRkxPQVQxNhAOEg0KCURUX1FJTlQxNhAPEg4KCkRUX1FVSU5UMTYQ", + "EBINCglEVF9VSU5UMTYQERIRCg1EVF9DT01QTEVYMTI4EBISCwoHRFRfSEFM", + "RhATEg8KC0RUX1JFU09VUkNFEBQSDgoKRFRfVkFSSUFOVBAVEg0KCURUX1VJ", + "TlQzMhAWEg0KCURUX1VJTlQ2NBAXEhAKDERUX0ZMT0FUX1JFRhBlEhEKDURU", + "X0RPVUJMRV9SRUYQZhIQCgxEVF9JTlQzMl9SRUYQZxIQCgxEVF9VSU5UOF9S", + "RUYQaBIQCgxEVF9JTlQxNl9SRUYQaRIPCgtEVF9JTlQ4X1JFRhBqEhEKDURU", + "X1NUUklOR19SRUYQaxIUChBEVF9DT01QTEVYNjRfUkVGEGwSEAoMRFRfSU5U", + "NjRfUkVGEG0SDwoLRFRfQk9PTF9SRUYQbhIQCgxEVF9RSU5UOF9SRUYQbxIR", + "Cg1EVF9RVUlOVDhfUkVGEHASEQoNRFRfUUlOVDMyX1JFRhBxEhMKD0RUX0JG", + "TE9BVDE2X1JFRhByEhEKDURUX1FJTlQxNl9SRUYQcxISCg5EVF9RVUlOVDE2", + "X1JFRhB0EhEKDURUX1VJTlQxNl9SRUYQdRIVChFEVF9DT01QTEVYMTI4X1JF", + "RhB2Eg8KC0RUX0hBTEZfUkVGEHcSEwoPRFRfUkVTT1VSQ0VfUkVGEHgSEgoO", + "RFRfVkFSSUFOVF9SRUYQeRIRCg1EVF9VSU5UMzJfUkVGEHoSEQoNRFRfVUlO", + "VDY0X1JFRhB7QmsKGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0ILVHlwZXNQ", + "cm90b3NQAVo9Z2l0aHViLmNvbS90ZW5zb3JmbG93L3RlbnNvcmZsb3cvdGVu", + "c29yZmxvdy9nby9jb3JlL2ZyYW1ld29ya/gBAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tensorflow.DataType), }, null)); diff --git a/src/TensorFlowNET.Core/Protobuf/Versions.cs b/src/TensorFlowNET.Core/Protobuf/Versions.cs index 6e97f1f7..c00b1232 100644 --- a/src/TensorFlowNET.Core/Protobuf/Versions.cs +++ b/src/TensorFlowNET.Core/Protobuf/Versions.cs @@ -1,6 +1,6 @@ // // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: versions.proto +// source: tensorflow/core/framework/versions.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Tensorflow { - /// Holder for reflection information generated from versions.proto + /// Holder for reflection information generated from tensorflow/core/framework/versions.proto public static partial class VersionsReflection { #region Descriptor - /// File descriptor for versions.proto + /// File descriptor for tensorflow/core/framework/versions.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -24,11 +24,12 @@ namespace Tensorflow { static VersionsReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cg52ZXJzaW9ucy5wcm90bxIKdGVuc29yZmxvdyJLCgpWZXJzaW9uRGVmEhAK", - "CHByb2R1Y2VyGAEgASgFEhQKDG1pbl9jb25zdW1lchgCIAEoBRIVCg1iYWRf", - "Y29uc3VtZXJzGAMgAygFQm4KGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IO", - "VmVyc2lvbnNQcm90b3NQAVo9Z2l0aHViLmNvbS90ZW5zb3JmbG93L3RlbnNv", - "cmZsb3cvdGVuc29yZmxvdy9nby9jb3JlL2ZyYW1ld29ya/gBAWIGcHJvdG8z")); + "Cih0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL3ZlcnNpb25zLnByb3RvEgp0", + "ZW5zb3JmbG93IksKClZlcnNpb25EZWYSEAoIcHJvZHVjZXIYASABKAUSFAoM", + "bWluX2NvbnN1bWVyGAIgASgFEhUKDWJhZF9jb25zdW1lcnMYAyADKAVCbgoY", + "b3JnLnRlbnNvcmZsb3cuZnJhbWV3b3JrQg5WZXJzaW9uc1Byb3Rvc1ABWj1n", + "aXRodWIuY29tL3RlbnNvcmZsb3cvdGVuc29yZmxvdy90ZW5zb3JmbG93L2dv", + "L2NvcmUvZnJhbWV3b3Jr+AEBYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { diff --git a/src/TensorFlowNET.Core/Sessions/SessionOptions.cs b/src/TensorFlowNET.Core/Sessions/SessionOptions.cs index 72ae890c..c6684390 100644 --- a/src/TensorFlowNET.Core/Sessions/SessionOptions.cs +++ b/src/TensorFlowNET.Core/Sessions/SessionOptions.cs @@ -1,4 +1,5 @@ -using System; +using Google.Protobuf; +using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; @@ -8,11 +9,13 @@ namespace Tensorflow public class SessionOptions : IDisposable { private IntPtr _handle; + private Status _status; public unsafe SessionOptions() { var opts = c_api.TF_NewSessionOptions(); _handle = opts; + _status = new Status(); } public unsafe SessionOptions(IntPtr handle) @@ -23,6 +26,17 @@ namespace Tensorflow public void Dispose() { c_api.TF_DeleteSessionOptions(_handle); + _status.Dispose(); + } + + public Status SetConfig(ConfigProto config) + { + var bytes = config.ToByteArray(); + var proto = Marshal.AllocHGlobal(bytes.Length); + Marshal.Copy(bytes, 0, proto, bytes.Length); + c_api.TF_SetConfig(_handle, proto, (ulong)bytes.Length, _status); + _status.Check(false); + return _status; } public static implicit operator IntPtr(SessionOptions opts) => opts._handle; diff --git a/src/TensorFlowNET.Core/Sessions/c_api.session.cs b/src/TensorFlowNET.Core/Sessions/c_api.session.cs index b1860cd2..0715f791 100644 --- a/src/TensorFlowNET.Core/Sessions/c_api.session.cs +++ b/src/TensorFlowNET.Core/Sessions/c_api.session.cs @@ -90,5 +90,18 @@ namespace Tensorflow IntPtr[] target_opers, int ntargets, IntPtr run_metadata, IntPtr status); + + /// + /// Set the config in TF_SessionOptions.options. + /// config should be a serialized tensorflow.ConfigProto proto. + /// If config was not parsed successfully as a ConfigProto, record the + /// error information in *status. + /// + /// TF_SessionOptions* + /// const void* + /// size_t + /// TF_Status* + [DllImport(TensorFlowLibName)] + public static extern unsafe void TF_SetConfig(IntPtr options, IntPtr proto, ulong proto_len, IntPtr status); } } diff --git a/test/TensorFlowNET.UnitTest/CSession.cs b/test/TensorFlowNET.UnitTest/CSession.cs index ad806465..a7cd36cc 100644 --- a/test/TensorFlowNET.UnitTest/CSession.cs +++ b/test/TensorFlowNET.UnitTest/CSession.cs @@ -26,6 +26,7 @@ namespace TensorFlowNET.UnitTest public CSession(Graph graph, Status s, bool user_XLA = false) { var opts = new SessionOptions(); + opts.SetConfig(new ConfigProto { InterOpParallelismThreads = 4 }); session_ = new Session(graph, opts, s); }