Skip to content

Commit b455626

Browse files
committed
added ConfigProto for SessionOptions.
1 parent c8767b1 commit b455626

30 files changed

Lines changed: 17623 additions & 171 deletions

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TensorFlow.NET provides .NET Standard binding for [TensorFlow](https://www.tenso
77
[![NuGet](https://img.shields.io/nuget/dt/TensorFlow.NET.svg)](https://www.nuget.org/packages/TensorFlow.NET)
88
[![Documentation Status](https://readthedocs.org/projects/tensorflownet/badge/?version=latest)](https://tensorflownet.readthedocs.io/en/latest/?badge=latest)
99

10-
TensorFlow.NET is a member project of [SciSharp](https://github.com/SciSharp) stack.
10+
TensorFlow.NET is a member project of [SciSharp STACK](https://github.com/SciSharp).
1111

1212
![tensors_flowing](docs/assets/tensors_flowing.gif)
1313

@@ -57,6 +57,15 @@ using(var sess = tf.Session())
5757

5858
Read the docs & book [The Definitive Guide to Tensorflow.NET](https://tensorflownet.readthedocs.io/en/latest/FrontCover.html).
5959

60+
More examples:
61+
62+
* [Hello World](test/TensorFlowNET.Examples/HelloWorld.cs)
63+
64+
* [Basic Operations](test/TensorFlowNET.Examples/BasicOperations.cs)
65+
* [Image Recognition](test/TensorFlowNET.Examples/ImageRecognition.cs)
66+
* [Linear Regression](test/TensorFlowNET.Examples/LinearRegression.cs)
67+
* [Text Classification with Movie Review](test/TensorFlowNET.Examples/TextClassificationWithMovieReviews.cs)
68+
6069
Star me or raise issue on [Github](https://github.com/SciSharp/TensorFlow.NET) feel free.
6170

6271
Scan QR code to join TIM group:
Lines changed: 337 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,337 @@
1+
// <auto-generated>
2+
// Generated by the protocol buffer compiler. DO NOT EDIT!
3+
// source: tensorflow/core/framework/allocation_description.proto
4+
// </auto-generated>
5+
#pragma warning disable 1591, 0612, 3021
6+
#region Designer generated code
7+
8+
using pb = global::Google.Protobuf;
9+
using pbc = global::Google.Protobuf.Collections;
10+
using pbr = global::Google.Protobuf.Reflection;
11+
using scg = global::System.Collections.Generic;
12+
namespace Tensorflow {
13+
14+
/// <summary>Holder for reflection information generated from tensorflow/core/framework/allocation_description.proto</summary>
15+
public static partial class AllocationDescriptionReflection {
16+
17+
#region Descriptor
18+
/// <summary>File descriptor for tensorflow/core/framework/allocation_description.proto</summary>
19+
public static pbr::FileDescriptor Descriptor {
20+
get { return descriptor; }
21+
}
22+
private static pbr::FileDescriptor descriptor;
23+
24+
static AllocationDescriptionReflection() {
25+
byte[] descriptorData = global::System.Convert.FromBase64String(
26+
string.Concat(
27+
"CjZ0ZW5zb3JmbG93L2NvcmUvZnJhbWV3b3JrL2FsbG9jYXRpb25fZGVzY3Jp",
28+
"cHRpb24ucHJvdG8SCnRlbnNvcmZsb3ciowEKFUFsbG9jYXRpb25EZXNjcmlw",
29+
"dGlvbhIXCg9yZXF1ZXN0ZWRfYnl0ZXMYASABKAMSFwoPYWxsb2NhdGVkX2J5",
30+
"dGVzGAIgASgDEhYKDmFsbG9jYXRvcl9uYW1lGAMgASgJEhUKDWFsbG9jYXRp",
31+
"b25faWQYBCABKAMSHAoUaGFzX3NpbmdsZV9yZWZlcmVuY2UYBSABKAgSCwoD",
32+
"cHRyGAYgASgEQnsKGG9yZy50ZW5zb3JmbG93LmZyYW1ld29ya0IbQWxsb2Nh",
33+
"dGlvbkRlc2NyaXB0aW9uUHJvdG9zUAFaPWdpdGh1Yi5jb20vdGVuc29yZmxv",
34+
"dy90ZW5zb3JmbG93L3RlbnNvcmZsb3cvZ28vY29yZS9mcmFtZXdvcmv4AQFi",
35+
"BnByb3RvMw=="));
36+
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
37+
new pbr::FileDescriptor[] { },
38+
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
39+
new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.AllocationDescription), global::Tensorflow.AllocationDescription.Parser, new[]{ "RequestedBytes", "AllocatedBytes", "AllocatorName", "AllocationId", "HasSingleReference", "Ptr" }, null, null, null)
40+
}));
41+
}
42+
#endregion
43+
44+
}
45+
#region Messages
46+
public sealed partial class AllocationDescription : pb::IMessage<AllocationDescription> {
47+
private static readonly pb::MessageParser<AllocationDescription> _parser = new pb::MessageParser<AllocationDescription>(() => new AllocationDescription());
48+
private pb::UnknownFieldSet _unknownFields;
49+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
50+
public static pb::MessageParser<AllocationDescription> Parser { get { return _parser; } }
51+
52+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
53+
public static pbr::MessageDescriptor Descriptor {
54+
get { return global::Tensorflow.AllocationDescriptionReflection.Descriptor.MessageTypes[0]; }
55+
}
56+
57+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
58+
pbr::MessageDescriptor pb::IMessage.Descriptor {
59+
get { return Descriptor; }
60+
}
61+
62+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
63+
public AllocationDescription() {
64+
OnConstruction();
65+
}
66+
67+
partial void OnConstruction();
68+
69+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
70+
public AllocationDescription(AllocationDescription other) : this() {
71+
requestedBytes_ = other.requestedBytes_;
72+
allocatedBytes_ = other.allocatedBytes_;
73+
allocatorName_ = other.allocatorName_;
74+
allocationId_ = other.allocationId_;
75+
hasSingleReference_ = other.hasSingleReference_;
76+
ptr_ = other.ptr_;
77+
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
78+
}
79+
80+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
81+
public AllocationDescription Clone() {
82+
return new AllocationDescription(this);
83+
}
84+
85+
/// <summary>Field number for the "requested_bytes" field.</summary>
86+
public const int RequestedBytesFieldNumber = 1;
87+
private long requestedBytes_;
88+
/// <summary>
89+
/// Total number of bytes requested
90+
/// </summary>
91+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
92+
public long RequestedBytes {
93+
get { return requestedBytes_; }
94+
set {
95+
requestedBytes_ = value;
96+
}
97+
}
98+
99+
/// <summary>Field number for the "allocated_bytes" field.</summary>
100+
public const int AllocatedBytesFieldNumber = 2;
101+
private long allocatedBytes_;
102+
/// <summary>
103+
/// Total number of bytes allocated if known
104+
/// </summary>
105+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
106+
public long AllocatedBytes {
107+
get { return allocatedBytes_; }
108+
set {
109+
allocatedBytes_ = value;
110+
}
111+
}
112+
113+
/// <summary>Field number for the "allocator_name" field.</summary>
114+
public const int AllocatorNameFieldNumber = 3;
115+
private string allocatorName_ = "";
116+
/// <summary>
117+
/// Name of the allocator used
118+
/// </summary>
119+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
120+
public string AllocatorName {
121+
get { return allocatorName_; }
122+
set {
123+
allocatorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
124+
}
125+
}
126+
127+
/// <summary>Field number for the "allocation_id" field.</summary>
128+
public const int AllocationIdFieldNumber = 4;
129+
private long allocationId_;
130+
/// <summary>
131+
/// Identifier of the allocated buffer if known
132+
/// </summary>
133+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
134+
public long AllocationId {
135+
get { return allocationId_; }
136+
set {
137+
allocationId_ = value;
138+
}
139+
}
140+
141+
/// <summary>Field number for the "has_single_reference" field.</summary>
142+
public const int HasSingleReferenceFieldNumber = 5;
143+
private bool hasSingleReference_;
144+
/// <summary>
145+
/// Set if this tensor only has one remaining reference
146+
/// </summary>
147+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
148+
public bool HasSingleReference {
149+
get { return hasSingleReference_; }
150+
set {
151+
hasSingleReference_ = value;
152+
}
153+
}
154+
155+
/// <summary>Field number for the "ptr" field.</summary>
156+
public const int PtrFieldNumber = 6;
157+
private ulong ptr_;
158+
/// <summary>
159+
/// Address of the allocation.
160+
/// </summary>
161+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
162+
public ulong Ptr {
163+
get { return ptr_; }
164+
set {
165+
ptr_ = value;
166+
}
167+
}
168+
169+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
170+
public override bool Equals(object other) {
171+
return Equals(other as AllocationDescription);
172+
}
173+
174+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
175+
public bool Equals(AllocationDescription other) {
176+
if (ReferenceEquals(other, null)) {
177+
return false;
178+
}
179+
if (ReferenceEquals(other, this)) {
180+
return true;
181+
}
182+
if (RequestedBytes != other.RequestedBytes) return false;
183+
if (AllocatedBytes != other.AllocatedBytes) return false;
184+
if (AllocatorName != other.AllocatorName) return false;
185+
if (AllocationId != other.AllocationId) return false;
186+
if (HasSingleReference != other.HasSingleReference) return false;
187+
if (Ptr != other.Ptr) return false;
188+
return Equals(_unknownFields, other._unknownFields);
189+
}
190+
191+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
192+
public override int GetHashCode() {
193+
int hash = 1;
194+
if (RequestedBytes != 0L) hash ^= RequestedBytes.GetHashCode();
195+
if (AllocatedBytes != 0L) hash ^= AllocatedBytes.GetHashCode();
196+
if (AllocatorName.Length != 0) hash ^= AllocatorName.GetHashCode();
197+
if (AllocationId != 0L) hash ^= AllocationId.GetHashCode();
198+
if (HasSingleReference != false) hash ^= HasSingleReference.GetHashCode();
199+
if (Ptr != 0UL) hash ^= Ptr.GetHashCode();
200+
if (_unknownFields != null) {
201+
hash ^= _unknownFields.GetHashCode();
202+
}
203+
return hash;
204+
}
205+
206+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
207+
public override string ToString() {
208+
return pb::JsonFormatter.ToDiagnosticString(this);
209+
}
210+
211+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
212+
public void WriteTo(pb::CodedOutputStream output) {
213+
if (RequestedBytes != 0L) {
214+
output.WriteRawTag(8);
215+
output.WriteInt64(RequestedBytes);
216+
}
217+
if (AllocatedBytes != 0L) {
218+
output.WriteRawTag(16);
219+
output.WriteInt64(AllocatedBytes);
220+
}
221+
if (AllocatorName.Length != 0) {
222+
output.WriteRawTag(26);
223+
output.WriteString(AllocatorName);
224+
}
225+
if (AllocationId != 0L) {
226+
output.WriteRawTag(32);
227+
output.WriteInt64(AllocationId);
228+
}
229+
if (HasSingleReference != false) {
230+
output.WriteRawTag(40);
231+
output.WriteBool(HasSingleReference);
232+
}
233+
if (Ptr != 0UL) {
234+
output.WriteRawTag(48);
235+
output.WriteUInt64(Ptr);
236+
}
237+
if (_unknownFields != null) {
238+
_unknownFields.WriteTo(output);
239+
}
240+
}
241+
242+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
243+
public int CalculateSize() {
244+
int size = 0;
245+
if (RequestedBytes != 0L) {
246+
size += 1 + pb::CodedOutputStream.ComputeInt64Size(RequestedBytes);
247+
}
248+
if (AllocatedBytes != 0L) {
249+
size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocatedBytes);
250+
}
251+
if (AllocatorName.Length != 0) {
252+
size += 1 + pb::CodedOutputStream.ComputeStringSize(AllocatorName);
253+
}
254+
if (AllocationId != 0L) {
255+
size += 1 + pb::CodedOutputStream.ComputeInt64Size(AllocationId);
256+
}
257+
if (HasSingleReference != false) {
258+
size += 1 + 1;
259+
}
260+
if (Ptr != 0UL) {
261+
size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Ptr);
262+
}
263+
if (_unknownFields != null) {
264+
size += _unknownFields.CalculateSize();
265+
}
266+
return size;
267+
}
268+
269+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
270+
public void MergeFrom(AllocationDescription other) {
271+
if (other == null) {
272+
return;
273+
}
274+
if (other.RequestedBytes != 0L) {
275+
RequestedBytes = other.RequestedBytes;
276+
}
277+
if (other.AllocatedBytes != 0L) {
278+
AllocatedBytes = other.AllocatedBytes;
279+
}
280+
if (other.AllocatorName.Length != 0) {
281+
AllocatorName = other.AllocatorName;
282+
}
283+
if (other.AllocationId != 0L) {
284+
AllocationId = other.AllocationId;
285+
}
286+
if (other.HasSingleReference != false) {
287+
HasSingleReference = other.HasSingleReference;
288+
}
289+
if (other.Ptr != 0UL) {
290+
Ptr = other.Ptr;
291+
}
292+
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
293+
}
294+
295+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
296+
public void MergeFrom(pb::CodedInputStream input) {
297+
uint tag;
298+
while ((tag = input.ReadTag()) != 0) {
299+
switch(tag) {
300+
default:
301+
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
302+
break;
303+
case 8: {
304+
RequestedBytes = input.ReadInt64();
305+
break;
306+
}
307+
case 16: {
308+
AllocatedBytes = input.ReadInt64();
309+
break;
310+
}
311+
case 26: {
312+
AllocatorName = input.ReadString();
313+
break;
314+
}
315+
case 32: {
316+
AllocationId = input.ReadInt64();
317+
break;
318+
}
319+
case 40: {
320+
HasSingleReference = input.ReadBool();
321+
break;
322+
}
323+
case 48: {
324+
Ptr = input.ReadUInt64();
325+
break;
326+
}
327+
}
328+
}
329+
}
330+
331+
}
332+
333+
#endregion
334+
335+
}
336+
337+
#endregion Designer generated code

0 commit comments

Comments
 (0)