Browse Source

added ConfigProto for SessionOptions.

tags/v0.8.0
haiping008 6 years ago
parent
commit
b4556262bc
30 changed files with 17623 additions and 171 deletions
  1. +10
    -1
      README.md
  2. +337
    -0
      src/TensorFlowNET.Core/Protobuf/AllocationDescription.cs
  3. +1328
    -0
      src/TensorFlowNET.Core/Protobuf/ApiDef.cs
  4. +26
    -23
      src/TensorFlowNET.Core/Protobuf/AttrValue.cs
  5. +339
    -0
      src/TensorFlowNET.Core/Protobuf/Cluster.cs
  6. +4270
    -0
      src/TensorFlowNET.Core/Protobuf/Config.cs
  7. +1155
    -0
      src/TensorFlowNET.Core/Protobuf/CostGraph.cs
  8. +893
    -0
      src/TensorFlowNET.Core/Protobuf/Debug.cs
  9. +860
    -0
      src/TensorFlowNET.Core/Protobuf/DeviceAttributes.cs
  10. +21
    -18
      src/TensorFlowNET.Core/Protobuf/Function.cs
  11. +14
    -11
      src/TensorFlowNET.Core/Protobuf/Graph.cs
  12. +1697
    -0
      src/TensorFlowNET.Core/Protobuf/GraphTransferInfo.cs
  13. +205
    -0
      src/TensorFlowNET.Core/Protobuf/Iterator.cs
  14. +628
    -0
      src/TensorFlowNET.Core/Protobuf/KernelDef.cs
  15. +1372
    -0
      src/TensorFlowNET.Core/Protobuf/LogMemory.cs
  16. +190
    -12
      src/TensorFlowNET.Core/Protobuf/NodeDef.cs
  17. +27
    -25
      src/TensorFlowNET.Core/Protobuf/OpDef.cs
  18. +31
    -15
      src/TensorFlowNET.Core/Protobuf/README.md
  19. +265
    -0
      src/TensorFlowNET.Core/Protobuf/ReaderBase.cs
  20. +10
    -10
      src/TensorFlowNET.Core/Protobuf/ResourceHandle.cs
  21. +1435
    -0
      src/TensorFlowNET.Core/Protobuf/RewriterConfig.cs
  22. +1787
    -0
      src/TensorFlowNET.Core/Protobuf/StepStats.cs
  23. +24
    -22
      src/TensorFlowNET.Core/Protobuf/Tensor.cs
  24. +259
    -0
      src/TensorFlowNET.Core/Protobuf/TensorDescription.cs
  25. +377
    -0
      src/TensorFlowNET.Core/Protobuf/TensorSlice.cs
  26. +25
    -25
      src/TensorFlowNET.Core/Protobuf/Types.cs
  27. +9
    -8
      src/TensorFlowNET.Core/Protobuf/Versions.cs
  28. +15
    -1
      src/TensorFlowNET.Core/Sessions/SessionOptions.cs
  29. +13
    -0
      src/TensorFlowNET.Core/Sessions/c_api.session.cs
  30. +1
    -0
      test/TensorFlowNET.UnitTest/CSession.cs

+ 10
- 1
README.md View File

@@ -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:


+ 337
- 0
src/TensorFlowNET.Core/Protobuf/AllocationDescription.cs View File

@@ -0,0 +1,337 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/allocation_description.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from tensorflow/core/framework/allocation_description.proto</summary>
public static partial class AllocationDescriptionReflection {

#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/allocation_description.proto</summary>
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<AllocationDescription> {
private static readonly pb::MessageParser<AllocationDescription> _parser = new pb::MessageParser<AllocationDescription>(() => new AllocationDescription());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AllocationDescription> 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);
}

/// <summary>Field number for the "requested_bytes" field.</summary>
public const int RequestedBytesFieldNumber = 1;
private long requestedBytes_;
/// <summary>
/// Total number of bytes requested
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long RequestedBytes {
get { return requestedBytes_; }
set {
requestedBytes_ = value;
}
}

/// <summary>Field number for the "allocated_bytes" field.</summary>
public const int AllocatedBytesFieldNumber = 2;
private long allocatedBytes_;
/// <summary>
/// Total number of bytes allocated if known
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long AllocatedBytes {
get { return allocatedBytes_; }
set {
allocatedBytes_ = value;
}
}

/// <summary>Field number for the "allocator_name" field.</summary>
public const int AllocatorNameFieldNumber = 3;
private string allocatorName_ = "";
/// <summary>
/// Name of the allocator used
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string AllocatorName {
get { return allocatorName_; }
set {
allocatorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "allocation_id" field.</summary>
public const int AllocationIdFieldNumber = 4;
private long allocationId_;
/// <summary>
/// Identifier of the allocated buffer if known
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long AllocationId {
get { return allocationId_; }
set {
allocationId_ = value;
}
}

/// <summary>Field number for the "has_single_reference" field.</summary>
public const int HasSingleReferenceFieldNumber = 5;
private bool hasSingleReference_;
/// <summary>
/// Set if this tensor only has one remaining reference
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool HasSingleReference {
get { return hasSingleReference_; }
set {
hasSingleReference_ = value;
}
}

/// <summary>Field number for the "ptr" field.</summary>
public const int PtrFieldNumber = 6;
private ulong ptr_;
/// <summary>
/// Address of the allocation.
/// </summary>
[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

+ 1328
- 0
src/TensorFlowNET.Core/Protobuf/ApiDef.cs
File diff suppressed because it is too large
View File


+ 26
- 23
src/TensorFlowNET.Core/Protobuf/AttrValue.cs View File

@@ -1,6 +1,6 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: attr_value.proto
// source: tensorflow/core/framework/attr_value.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from attr_value.proto</summary>
/// <summary>Holder for reflection information generated from tensorflow/core/framework/attr_value.proto</summary>
public static partial class AttrValueReflection {

#region Descriptor
/// <summary>File descriptor for attr_value.proto</summary>
/// <summary>File descriptor for tensorflow/core/framework/attr_value.proto</summary>
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[] {


+ 339
- 0
src/TensorFlowNET.Core/Protobuf/Cluster.cs View File

@@ -0,0 +1,339 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/cluster.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/cluster.proto</summary>
public static partial class ClusterReflection {

#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/cluster.proto</summary>
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
/// <summary>
/// Defines a single job in a TensorFlow cluster.
/// </summary>
public sealed partial class JobDef : pb::IMessage<JobDef> {
private static readonly pb::MessageParser<JobDef> _parser = new pb::MessageParser<JobDef>(() => new JobDef());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<JobDef> 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);
}

/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// The name of this job.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "tasks" field.</summary>
public const int TasksFieldNumber = 2;
private static readonly pbc::MapField<int, string>.Codec _map_tasks_codec
= new pbc::MapField<int, string>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForString(18), 18);
private readonly pbc::MapField<int, string> tasks_ = new pbc::MapField<int, string>();
/// <summary>
/// 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".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<int, string> 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;
}
}
}
}

}

/// <summary>
/// Defines a TensorFlow cluster as a set of jobs.
/// </summary>
public sealed partial class ClusterDef : pb::IMessage<ClusterDef> {
private static readonly pb::MessageParser<ClusterDef> _parser = new pb::MessageParser<ClusterDef>(() => new ClusterDef());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ClusterDef> 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);
}

/// <summary>Field number for the "job" field.</summary>
public const int JobFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.JobDef> _repeated_job_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.JobDef.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.JobDef> job_ = new pbc::RepeatedField<global::Tensorflow.JobDef>();
/// <summary>
/// The jobs that comprise the cluster.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.JobDef> 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

+ 4270
- 0
src/TensorFlowNET.Core/Protobuf/Config.cs
File diff suppressed because it is too large
View File


+ 1155
- 0
src/TensorFlowNET.Core/Protobuf/CostGraph.cs
File diff suppressed because it is too large
View File


+ 893
- 0
src/TensorFlowNET.Core/Protobuf/Debug.cs View File

@@ -0,0 +1,893 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/debug.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from tensorflow/core/protobuf/debug.proto</summary>
public static partial class DebugReflection {

#region Descriptor
/// <summary>File descriptor for tensorflow/core/protobuf/debug.proto</summary>
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
/// <summary>
/// Option for watching a node in TensorFlow Debugger (tfdbg).
/// </summary>
public sealed partial class DebugTensorWatch : pb::IMessage<DebugTensorWatch> {
private static readonly pb::MessageParser<DebugTensorWatch> _parser = new pb::MessageParser<DebugTensorWatch>(() => new DebugTensorWatch());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DebugTensorWatch> 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);
}

/// <summary>Field number for the "node_name" field.</summary>
public const int NodeNameFieldNumber = 1;
private string nodeName_ = "";
/// <summary>
/// Name of the node to watch.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string NodeName {
get { return nodeName_; }
set {
nodeName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "output_slot" field.</summary>
public const int OutputSlotFieldNumber = 2;
private int outputSlot_;
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int OutputSlot {
get { return outputSlot_; }
set {
outputSlot_ = value;
}
}

/// <summary>Field number for the "debug_ops" field.</summary>
public const int DebugOpsFieldNumber = 3;
private static readonly pb::FieldCodec<string> _repeated_debugOps_codec
= pb::FieldCodec.ForString(26);
private readonly pbc::RepeatedField<string> debugOps_ = new pbc::RepeatedField<string>();
/// <summary>
/// Name(s) of the debugging op(s).
/// One or more than one probes on a tensor.
/// e.g., {"DebugIdentity", "DebugNanCount"}
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> DebugOps {
get { return debugOps_; }
}

/// <summary>Field number for the "debug_urls" field.</summary>
public const int DebugUrlsFieldNumber = 4;
private static readonly pb::FieldCodec<string> _repeated_debugUrls_codec
= pb::FieldCodec.ForString(34);
private readonly pbc::RepeatedField<string> debugUrls_ = new pbc::RepeatedField<string>();
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> DebugUrls {
get { return debugUrls_; }
}

/// <summary>Field number for the "tolerate_debug_op_creation_failures" field.</summary>
public const int TolerateDebugOpCreationFailuresFieldNumber = 5;
private bool tolerateDebugOpCreationFailures_;
/// <summary>
/// Do not error out if debug op creation fails (e.g., due to dtype
/// incompatibility). Instead, just log the failure.
/// </summary>
[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;
}
}
}
}

}

/// <summary>
/// Options for initializing DebuggerState in TensorFlow Debugger (tfdbg).
/// </summary>
public sealed partial class DebugOptions : pb::IMessage<DebugOptions> {
private static readonly pb::MessageParser<DebugOptions> _parser = new pb::MessageParser<DebugOptions>(() => new DebugOptions());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DebugOptions> 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);
}

/// <summary>Field number for the "debug_tensor_watch_opts" field.</summary>
public const int DebugTensorWatchOptsFieldNumber = 4;
private static readonly pb::FieldCodec<global::Tensorflow.DebugTensorWatch> _repeated_debugTensorWatchOpts_codec
= pb::FieldCodec.ForMessage(34, global::Tensorflow.DebugTensorWatch.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.DebugTensorWatch> debugTensorWatchOpts_ = new pbc::RepeatedField<global::Tensorflow.DebugTensorWatch>();
/// <summary>
/// Debugging options
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.DebugTensorWatch> DebugTensorWatchOpts {
get { return debugTensorWatchOpts_; }
}

/// <summary>Field number for the "global_step" field.</summary>
public const int GlobalStepFieldNumber = 10;
private long globalStep_;
/// <summary>
/// Caller-specified global step count.
/// Note that this is distinct from the session run count and the executor
/// step count.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long GlobalStep {
get { return globalStep_; }
set {
globalStep_ = value;
}
}

/// <summary>Field number for the "reset_disk_byte_usage" field.</summary>
public const int ResetDiskByteUsageFieldNumber = 11;
private bool resetDiskByteUsage_;
/// <summary>
/// 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.
/// </summary>
[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<DebuggedSourceFile> {
private static readonly pb::MessageParser<DebuggedSourceFile> _parser = new pb::MessageParser<DebuggedSourceFile>(() => new DebuggedSourceFile());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DebuggedSourceFile> 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);
}

/// <summary>Field number for the "host" field.</summary>
public const int HostFieldNumber = 1;
private string host_ = "";
/// <summary>
/// The host name on which a source code file is located.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Host {
get { return host_; }
set {
host_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "file_path" field.</summary>
public const int FilePathFieldNumber = 2;
private string filePath_ = "";
/// <summary>
/// Path to the source code file.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string FilePath {
get { return filePath_; }
set {
filePath_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "last_modified" field.</summary>
public const int LastModifiedFieldNumber = 3;
private long lastModified_;
/// <summary>
/// The timestamp at which the source code file is last modified.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long LastModified {
get { return lastModified_; }
set {
lastModified_ = value;
}
}

/// <summary>Field number for the "bytes" field.</summary>
public const int BytesFieldNumber = 4;
private long bytes_;
/// <summary>
/// Byte size of the file.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Bytes {
get { return bytes_; }
set {
bytes_ = value;
}
}

/// <summary>Field number for the "lines" field.</summary>
public const int LinesFieldNumber = 5;
private static readonly pb::FieldCodec<string> _repeated_lines_codec
= pb::FieldCodec.ForString(42);
private readonly pbc::RepeatedField<string> lines_ = new pbc::RepeatedField<string>();
/// <summary>
/// Line-by-line content of the source code file.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> 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<DebuggedSourceFiles> {
private static readonly pb::MessageParser<DebuggedSourceFiles> _parser = new pb::MessageParser<DebuggedSourceFiles>(() => new DebuggedSourceFiles());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DebuggedSourceFiles> 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);
}

/// <summary>Field number for the "source_files" field.</summary>
public const int SourceFilesFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.DebuggedSourceFile> _repeated_sourceFiles_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.DebuggedSourceFile.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.DebuggedSourceFile> sourceFiles_ = new pbc::RepeatedField<global::Tensorflow.DebuggedSourceFile>();
/// <summary>
/// A collection of source code files.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.DebuggedSourceFile> 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

+ 860
- 0
src/TensorFlowNET.Core/Protobuf/DeviceAttributes.cs View File

@@ -0,0 +1,860 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/device_attributes.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from tensorflow/core/framework/device_attributes.proto</summary>
public static partial class DeviceAttributesReflection {

#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/device_attributes.proto</summary>
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<InterconnectLink> {
private static readonly pb::MessageParser<InterconnectLink> _parser = new pb::MessageParser<InterconnectLink>(() => new InterconnectLink());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<InterconnectLink> 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);
}

/// <summary>Field number for the "device_id" field.</summary>
public const int DeviceIdFieldNumber = 1;
private int deviceId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int DeviceId {
get { return deviceId_; }
set {
deviceId_ = value;
}
}

/// <summary>Field number for the "type" field.</summary>
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");
}
}

/// <summary>Field number for the "strength" field.</summary>
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<LocalLinks> {
private static readonly pb::MessageParser<LocalLinks> _parser = new pb::MessageParser<LocalLinks>(() => new LocalLinks());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<LocalLinks> 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);
}

/// <summary>Field number for the "link" field.</summary>
public const int LinkFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.InterconnectLink> _repeated_link_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.InterconnectLink.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.InterconnectLink> link_ = new pbc::RepeatedField<global::Tensorflow.InterconnectLink>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.InterconnectLink> 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<DeviceLocality> {
private static readonly pb::MessageParser<DeviceLocality> _parser = new pb::MessageParser<DeviceLocality>(() => new DeviceLocality());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DeviceLocality> 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);
}

/// <summary>Field number for the "bus_id" field.</summary>
public const int BusIdFieldNumber = 1;
private int busId_;
/// <summary>
/// Optional bus locality of device. Default value of 0 means
/// no specific locality. Specific localities are indexed from 1.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int BusId {
get { return busId_; }
set {
busId_ = value;
}
}

/// <summary>Field number for the "numa_node" field.</summary>
public const int NumaNodeFieldNumber = 2;
private int numaNode_;
/// <summary>
/// Optional NUMA locality of device.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int NumaNode {
get { return numaNode_; }
set {
numaNode_ = value;
}
}

/// <summary>Field number for the "links" field.</summary>
public const int LinksFieldNumber = 3;
private global::Tensorflow.LocalLinks links_;
/// <summary>
/// Optional local interconnect links to other devices.
/// </summary>
[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<DeviceAttributes> {
private static readonly pb::MessageParser<DeviceAttributes> _parser = new pb::MessageParser<DeviceAttributes>(() => new DeviceAttributes());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DeviceAttributes> 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);
}

/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Fully specified name of the device within a cluster.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "device_type" field.</summary>
public const int DeviceTypeFieldNumber = 2;
private string deviceType_ = "";
/// <summary>
/// String representation of device_type.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DeviceType {
get { return deviceType_; }
set {
deviceType_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "memory_limit" field.</summary>
public const int MemoryLimitFieldNumber = 4;
private long memoryLimit_;
/// <summary>
/// Memory capacity of device in bytes.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long MemoryLimit {
get { return memoryLimit_; }
set {
memoryLimit_ = value;
}
}

/// <summary>Field number for the "locality" field.</summary>
public const int LocalityFieldNumber = 5;
private global::Tensorflow.DeviceLocality locality_;
/// <summary>
/// Platform-specific data about device that may be useful
/// for supporting efficient data transfers.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.DeviceLocality Locality {
get { return locality_; }
set {
locality_ = value;
}
}

/// <summary>Field number for the "incarnation" field.</summary>
public const int IncarnationFieldNumber = 6;
private ulong incarnation_;
/// <summary>
/// A device is assigned a global unique number each time it is
/// initialized. "incarnation" should never be 0.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ulong Incarnation {
get { return incarnation_; }
set {
incarnation_ = value;
}
}

/// <summary>Field number for the "physical_device_desc" field.</summary>
public const int PhysicalDeviceDescFieldNumber = 7;
private string physicalDeviceDesc_ = "";
/// <summary>
/// String representation of the physical device that this device maps to.
/// </summary>
[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

+ 21
- 18
src/TensorFlowNET.Core/Protobuf/Function.cs View File

@@ -1,6 +1,6 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: function.proto
// source: tensorflow/core/framework/function.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from function.proto</summary>
/// <summary>Holder for reflection information generated from tensorflow/core/framework/function.proto</summary>
public static partial class FunctionReflection {

#region Descriptor
/// <summary>File descriptor for function.proto</summary>
/// <summary>File descriptor for tensorflow/core/framework/function.proto</summary>
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[] {


+ 14
- 11
src/TensorFlowNET.Core/Protobuf/Graph.cs View File

@@ -1,6 +1,6 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: graph.proto
// source: tensorflow/core/framework/graph.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from graph.proto</summary>
/// <summary>Holder for reflection information generated from tensorflow/core/framework/graph.proto</summary>
public static partial class GraphReflection {

#region Descriptor
/// <summary>File descriptor for graph.proto</summary>
/// <summary>File descriptor for tensorflow/core/framework/graph.proto</summary>
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[] {


+ 1697
- 0
src/TensorFlowNET.Core/Protobuf/GraphTransferInfo.cs
File diff suppressed because it is too large
View File


+ 205
- 0
src/TensorFlowNET.Core/Protobuf/Iterator.cs View File

@@ -0,0 +1,205 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/iterator.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from tensorflow/core/framework/iterator.proto</summary>
public static partial class IteratorReflection {

#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/iterator.proto</summary>
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
/// <summary>
/// Protocol buffer representing the metadata for an iterator's state stored
/// as a Variant tensor.
/// </summary>
public sealed partial class IteratorStateMetadata : pb::IMessage<IteratorStateMetadata> {
private static readonly pb::MessageParser<IteratorStateMetadata> _parser = new pb::MessageParser<IteratorStateMetadata>(() => new IteratorStateMetadata());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<IteratorStateMetadata> 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);
}

/// <summary>Field number for the "version" field.</summary>
public const int VersionFieldNumber = 1;
private string version_ = "";
/// <summary>
/// A user-specified version string.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Version {
get { return version_; }
set {
version_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "keys" field.</summary>
public const int KeysFieldNumber = 2;
private static readonly pb::FieldCodec<string> _repeated_keys_codec
= pb::FieldCodec.ForString(18);
private readonly pbc::RepeatedField<string> keys_ = new pbc::RepeatedField<string>();
/// <summary>
/// Keys for tensors in the VariantTensorDataProto.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> 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

+ 628
- 0
src/TensorFlowNET.Core/Protobuf/KernelDef.cs View File

@@ -0,0 +1,628 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/kernel_def.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from tensorflow/core/framework/kernel_def.proto</summary>
public static partial class KernelDefReflection {

#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/kernel_def.proto</summary>
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<KernelDef> {
private static readonly pb::MessageParser<KernelDef> _parser = new pb::MessageParser<KernelDef>(() => new KernelDef());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<KernelDef> 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);
}

/// <summary>Field number for the "op" field.</summary>
public const int OpFieldNumber = 1;
private string op_ = "";
/// <summary>
/// Must match the name of an Op.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Op {
get { return op_; }
set {
op_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "device_type" field.</summary>
public const int DeviceTypeFieldNumber = 2;
private string deviceType_ = "";
/// <summary>
/// Type of device this kernel runs on.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DeviceType {
get { return deviceType_; }
set {
deviceType_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "constraint" field.</summary>
public const int ConstraintFieldNumber = 3;
private static readonly pb::FieldCodec<global::Tensorflow.KernelDef.Types.AttrConstraint> _repeated_constraint_codec
= pb::FieldCodec.ForMessage(26, global::Tensorflow.KernelDef.Types.AttrConstraint.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.KernelDef.Types.AttrConstraint> constraint_ = new pbc::RepeatedField<global::Tensorflow.KernelDef.Types.AttrConstraint>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.KernelDef.Types.AttrConstraint> Constraint {
get { return constraint_; }
}

/// <summary>Field number for the "host_memory_arg" field.</summary>
public const int HostMemoryArgFieldNumber = 4;
private static readonly pb::FieldCodec<string> _repeated_hostMemoryArg_codec
= pb::FieldCodec.ForString(34);
private readonly pbc::RepeatedField<string> hostMemoryArg_ = new pbc::RepeatedField<string>();
/// <summary>
/// Names of the Op's input_/output_args that reside in host memory
/// instead of device memory.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> HostMemoryArg {
get { return hostMemoryArg_; }
}

/// <summary>Field number for the "label" field.</summary>
public const int LabelFieldNumber = 5;
private string label_ = "";
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Label {
get { return label_; }
set {
label_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "priority" field.</summary>
public const int PriorityFieldNumber = 6;
private int priority_;
/// <summary>
/// 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.
/// </summary>
[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
/// <summary>Container for nested types declared in the KernelDef message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
public sealed partial class AttrConstraint : pb::IMessage<AttrConstraint> {
private static readonly pb::MessageParser<AttrConstraint> _parser = new pb::MessageParser<AttrConstraint>(() => new AttrConstraint());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AttrConstraint> 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);
}

/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Name of an attr from the Op.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "allowed_values" field.</summary>
public const int AllowedValuesFieldNumber = 2;
private global::Tensorflow.AttrValue allowedValues_;
/// <summary>
/// A list of values that this kernel supports for this attr.
/// Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
/// </summary>
[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

}

/// <summary>
/// A collection of KernelDefs
/// </summary>
public sealed partial class KernelList : pb::IMessage<KernelList> {
private static readonly pb::MessageParser<KernelList> _parser = new pb::MessageParser<KernelList>(() => new KernelList());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<KernelList> 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);
}

/// <summary>Field number for the "kernel" field.</summary>
public const int KernelFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.KernelDef> _repeated_kernel_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.KernelDef.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.KernelDef> kernel_ = new pbc::RepeatedField<global::Tensorflow.KernelDef>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.KernelDef> 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

+ 1372
- 0
src/TensorFlowNET.Core/Protobuf/LogMemory.cs
File diff suppressed because it is too large
View File


+ 190
- 12
src/TensorFlowNET.Core/Protobuf/NodeDef.cs View File

@@ -1,6 +1,6 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: node_def.proto
// source: tensorflow/core/framework/node_def.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from node_def.proto</summary>
/// <summary>Holder for reflection information generated from tensorflow/core/framework/node_def.proto</summary>
public static partial class NodeDefReflection {

#region Descriptor
/// <summary>File descriptor for node_def.proto</summary>
/// <summary>File descriptor for tensorflow/core/framework/node_def.proto</summary>
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_; }
}

/// <summary>Field number for the "experimental_debug_info" field.</summary>
public const int ExperimentalDebugInfoFieldNumber = 6;
private global::Tensorflow.NodeDef.Types.ExperimentalDebugInfo experimentalDebugInfo_;
/// <summary>
/// This stores debug information associated with the node.
/// </summary>
[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
/// <summary>Container for nested types declared in the NodeDef message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
public sealed partial class ExperimentalDebugInfo : pb::IMessage<ExperimentalDebugInfo> {
private static readonly pb::MessageParser<ExperimentalDebugInfo> _parser = new pb::MessageParser<ExperimentalDebugInfo>(() => new ExperimentalDebugInfo());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ExperimentalDebugInfo> 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);
}

/// <summary>Field number for the "original_node_names" field.</summary>
public const int OriginalNodeNamesFieldNumber = 1;
private static readonly pb::FieldCodec<string> _repeated_originalNodeNames_codec
= pb::FieldCodec.ForString(10);
private readonly pbc::RepeatedField<string> originalNodeNames_ = new pbc::RepeatedField<string>();
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> 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

}



+ 27
- 25
src/TensorFlowNET.Core/Protobuf/OpDef.cs View File

@@ -1,6 +1,6 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: op_def.proto
// source: tensorflow/core/framework/op_def.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from op_def.proto</summary>
/// <summary>Holder for reflection information generated from tensorflow/core/framework/op_def.proto</summary>
public static partial class OpDefReflection {

#region Descriptor
/// <summary>File descriptor for op_def.proto</summary>
/// <summary>File descriptor for tensorflow/core/framework/op_def.proto</summary>
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[] {


+ 31
- 15
src/TensorFlowNET.Core/Protobuf/README.md View File

@@ -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
```


+ 265
- 0
src/TensorFlowNET.Core/Protobuf/ReaderBase.cs View File

@@ -0,0 +1,265 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/reader_base.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from tensorflow/core/framework/reader_base.proto</summary>
public static partial class ReaderBaseReflection {

#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/reader_base.proto</summary>
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
/// <summary>
/// For serializing and restoring the state of ReaderBase, see
/// reader_base.h for details.
/// </summary>
public sealed partial class ReaderBaseState : pb::IMessage<ReaderBaseState> {
private static readonly pb::MessageParser<ReaderBaseState> _parser = new pb::MessageParser<ReaderBaseState>(() => new ReaderBaseState());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ReaderBaseState> 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);
}

/// <summary>Field number for the "work_started" field.</summary>
public const int WorkStartedFieldNumber = 1;
private long workStarted_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long WorkStarted {
get { return workStarted_; }
set {
workStarted_ = value;
}
}

/// <summary>Field number for the "work_finished" field.</summary>
public const int WorkFinishedFieldNumber = 2;
private long workFinished_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long WorkFinished {
get { return workFinished_; }
set {
workFinished_ = value;
}
}

/// <summary>Field number for the "num_records_produced" field.</summary>
public const int NumRecordsProducedFieldNumber = 3;
private long numRecordsProduced_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long NumRecordsProduced {
get { return numRecordsProduced_; }
set {
numRecordsProduced_ = value;
}
}

/// <summary>Field number for the "current_work" field.</summary>
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

+ 10
- 10
src/TensorFlowNET.Core/Protobuf/ResourceHandle.cs View File

@@ -1,6 +1,6 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: resource_handle.proto
// source: tensorflow/core/framework/resource_handle.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from resource_handle.proto</summary>
/// <summary>Holder for reflection information generated from tensorflow/core/framework/resource_handle.proto</summary>
public static partial class ResourceHandleReflection {

#region Descriptor
/// <summary>File descriptor for resource_handle.proto</summary>
/// <summary>File descriptor for tensorflow/core/framework/resource_handle.proto</summary>
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[] {


+ 1435
- 0
src/TensorFlowNET.Core/Protobuf/RewriterConfig.cs
File diff suppressed because it is too large
View File


+ 1787
- 0
src/TensorFlowNET.Core/Protobuf/StepStats.cs
File diff suppressed because it is too large
View File


+ 24
- 22
src/TensorFlowNET.Core/Protobuf/Tensor.cs View File

@@ -1,6 +1,6 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensor.proto
// source: tensorflow/core/framework/tensor.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from tensor.proto</summary>
/// <summary>Holder for reflection information generated from tensorflow/core/framework/tensor.proto</summary>
public static partial class TensorReflection {

#region Descriptor
/// <summary>File descriptor for tensor.proto</summary>
/// <summary>File descriptor for tensorflow/core/framework/tensor.proto</summary>
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[] {


+ 259
- 0
src/TensorFlowNET.Core/Protobuf/TensorDescription.cs View File

@@ -0,0 +1,259 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/tensor_description.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from tensorflow/core/framework/tensor_description.proto</summary>
public static partial class TensorDescriptionReflection {

#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/tensor_description.proto</summary>
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<TensorDescription> {
private static readonly pb::MessageParser<TensorDescription> _parser = new pb::MessageParser<TensorDescription>(() => new TensorDescription());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TensorDescription> 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);
}

/// <summary>Field number for the "dtype" field.</summary>
public const int DtypeFieldNumber = 1;
private global::Tensorflow.DataType dtype_ = 0;
/// <summary>
/// Data type of tensor elements
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.DataType Dtype {
get { return dtype_; }
set {
dtype_ = value;
}
}

/// <summary>Field number for the "shape" field.</summary>
public const int ShapeFieldNumber = 2;
private global::Tensorflow.TensorShapeProto shape_;
/// <summary>
/// Shape of the tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.TensorShapeProto Shape {
get { return shape_; }
set {
shape_ = value;
}
}

/// <summary>Field number for the "allocation_description" field.</summary>
public const int AllocationDescriptionFieldNumber = 4;
private global::Tensorflow.AllocationDescription allocationDescription_;
/// <summary>
/// Information about the size and allocator used for the data
/// </summary>
[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

+ 377
- 0
src/TensorFlowNET.Core/Protobuf/TensorSlice.cs View File

@@ -0,0 +1,377 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/tensor_slice.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from tensorflow/core/framework/tensor_slice.proto</summary>
public static partial class TensorSliceReflection {

#region Descriptor
/// <summary>File descriptor for tensorflow/core/framework/tensor_slice.proto</summary>
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
/// <summary>
/// Can only be interpreted if you know the corresponding TensorShape.
/// </summary>
public sealed partial class TensorSliceProto : pb::IMessage<TensorSliceProto> {
private static readonly pb::MessageParser<TensorSliceProto> _parser = new pb::MessageParser<TensorSliceProto>(() => new TensorSliceProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TensorSliceProto> 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);
}

/// <summary>Field number for the "extent" field.</summary>
public const int ExtentFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.TensorSliceProto.Types.Extent> _repeated_extent_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.TensorSliceProto.Types.Extent.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.TensorSliceProto.Types.Extent> extent_ = new pbc::RepeatedField<global::Tensorflow.TensorSliceProto.Types.Extent>();
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.TensorSliceProto.Types.Extent> 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
/// <summary>Container for nested types declared in the TensorSliceProto message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
/// Extent of the slice in one dimension.
/// </summary>
public sealed partial class Extent : pb::IMessage<Extent> {
private static readonly pb::MessageParser<Extent> _parser = new pb::MessageParser<Extent>(() => new Extent());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Extent> 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);
}

/// <summary>Field number for the "start" field.</summary>
public const int StartFieldNumber = 1;
private long start_;
/// <summary>
/// Start index of the slice, starting at 0.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Start {
get { return start_; }
set {
start_ = value;
}
}

/// <summary>Field number for the "length" field.</summary>
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_;
/// <summary>Enum of possible cases for the "has_length" oneof.</summary>
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

+ 25
- 25
src/TensorFlowNET.Core/Protobuf/Types.cs View File

@@ -1,6 +1,6 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: types.proto
// source: tensorflow/core/framework/types.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from types.proto</summary>
/// <summary>Holder for reflection information generated from tensorflow/core/framework/types.proto</summary>
public static partial class TypesReflection {

#region Descriptor
/// <summary>File descriptor for types.proto</summary>
/// <summary>File descriptor for tensorflow/core/framework/types.proto</summary>
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));


+ 9
- 8
src/TensorFlowNET.Core/Protobuf/Versions.cs View File

@@ -1,6 +1,6 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: versions.proto
// source: tensorflow/core/framework/versions.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from versions.proto</summary>
/// <summary>Holder for reflection information generated from tensorflow/core/framework/versions.proto</summary>
public static partial class VersionsReflection {

#region Descriptor
/// <summary>File descriptor for versions.proto</summary>
/// <summary>File descriptor for tensorflow/core/framework/versions.proto</summary>
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[] {


+ 15
- 1
src/TensorFlowNET.Core/Sessions/SessionOptions.cs View File

@@ -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;


+ 13
- 0
src/TensorFlowNET.Core/Sessions/c_api.session.cs View File

@@ -90,5 +90,18 @@ namespace Tensorflow
IntPtr[] target_opers, int ntargets,
IntPtr run_metadata,
IntPtr status);

/// <summary>
/// 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.
/// </summary>
/// <param name="options">TF_SessionOptions*</param>
/// <param name="proto">const void*</param>
/// <param name="proto_len">size_t</param>
/// <param name="status">TF_Status*</param>
[DllImport(TensorFlowLibName)]
public static extern unsafe void TF_SetConfig(IntPtr options, IntPtr proto, ulong proto_len, IntPtr status);
}
}

+ 1
- 0
test/TensorFlowNET.UnitTest/CSession.cs View File

@@ -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);
}



Loading…
Cancel
Save