Skip to content

Commit 587c421

Browse files
committed
Basic Operations passed.
1 parent bd636e5 commit 587c421

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/TensorFlowNET.Examples/BasicOperations.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public bool Run()
5353
new FeedItem(b, (short)3)
5454
};
5555
// Run every operation with variable input
56-
Console.WriteLine($"Addition with variables: {sess.run(add, feed_dict)}");
57-
Console.WriteLine($"Multiplication with variables: {sess.run(mul, feed_dict)}");
56+
Console.WriteLine($"Addition with variables: {sess.run(add, feed_dict)[0]}");
57+
Console.WriteLine($"Multiplication with variables: {sess.run(mul, feed_dict)[0]}");
5858
}
5959

6060
// ----------------
@@ -91,7 +91,7 @@ public bool Run()
9191
// The output of the op is returned in 'result' as a numpy `ndarray` object.
9292
using (sess = tf.Session())
9393
{
94-
var result = sess.run(product);
94+
var result = sess.run(product)[0];
9595
Console.WriteLine(result.ToString()); // ==> [[ 12.]]
9696
};
9797

@@ -136,7 +136,7 @@ public bool Run()
136136
var checkTensor = np.array<float>(0, 6, 0, 15, 0, 24, 3, 1, 6, 4, 9, 7, 6, 0, 15, 0, 24, 0);
137137
using (var sess = tf.Session())
138138
{
139-
var result = sess.run(batchMul);
139+
var result = sess.run(batchMul)[0];
140140
Console.WriteLine(result.ToString());
141141
//
142142
// ==> array([[[0, 6],

0 commit comments

Comments
 (0)