Skip to content

Commit

Permalink
TensorFlow 1.4 C API bindings + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldeicaza committed Nov 7, 2017
1 parent 1ebcf43 commit 9b32ca9
Show file tree
Hide file tree
Showing 5 changed files with 382 additions and 16 deletions.
4 changes: 2 additions & 2 deletions SampleTest/LowLevelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class AttributeTest : IDisposable
static int counter;
public TFStatus Status;
TFGraph graph;
TFOperationDesc desc;
//TFOperationDesc desc;

public AttributeTest ()
{
Expand Down Expand Up @@ -331,7 +331,7 @@ public void AddControlInput ()
runner.AddTarget (noop);
runner.Run ();
throw new Exception ("This should have thrown an exception");
} catch (Exception e) {
} catch (Exception) {
Console.WriteLine ("Success, got the expected exception when using tensorflow control inputs to assert");
}
}
Expand Down
3 changes: 3 additions & 0 deletions TensorFlowSharp/Buffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public class TFBuffer : TFDisposable

internal TFBuffer (IntPtr handle) : base (handle) { }

/// <summary>
/// Initializes a new instance of the <see cref="T:TensorFlow.TFBuffer"/> class.
/// </summary>
unsafe public TFBuffer () : base ((IntPtr)TF_NewBuffer ())
{
}
Expand Down
4 changes: 4 additions & 0 deletions TensorFlowSharp/Queue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public QueueBase (TFSession session)
Session = session ?? throw new ArgumentNullException (nameof (session));
}

/// <summary>
/// The session that this QueueBased was created for.
/// </summary>
/// <value>The session.</value>
protected TFSession Session { get; private set; }

/// <summary>
Expand Down
12 changes: 4 additions & 8 deletions TensorFlowSharp/Tensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,10 @@ public object GetValue (bool jagged = false)
}
}

/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:TensorFlow.TFTensor"/>.
/// </summary>
/// <returns>A <see cref="T:System.String"/> that represents the current <see cref="T:TensorFlow.TFTensor"/>.</returns>
public override string ToString ()
{
var n = NumDims;
Expand All @@ -1134,14 +1138,6 @@ public override string ToString ()
return sb.ToString ();
}









private static int [] getLength (Array array, bool deep = true, bool max = false)
{
// This function gets the length of all dimensions in a multidimensional, jagged, or mixed array.
Expand Down
Loading

0 comments on commit 9b32ca9

Please sign in to comment.