Skip to content

Commit 0045838

Browse files
authored
Merge pull request SciSharp#161 from Esther2013/master
changes for example project
2 parents f2c8883 + aac35af commit 0045838

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎test/TensorFlowNET.Examples/HelloWorld.cs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ public void Run()
1818
1919
The value returned by the constructor represents the output
2020
of the Constant op. */
21-
var hello = tf.constant("Hello, TensorFlow!");
21+
var str = "Hello, TensorFlow!";
22+
var hello = tf.constant(str);
2223

2324
// Start tf session
2425
using (var sess = tf.Session())
2526
{
2627
// Run the op
2728
var result = sess.run(hello);
2829
Console.WriteLine(result.ToString());
29-
if(!result.ToString().Equals("Hello, TensorFlow!"))
30+
if(!result.ToString().Equals(str))
3031
{
31-
throw new ValueError("HelloWorld");
32+
throw new ValueError("HelloWorld example acts in unexpected way.");
3233
}
3334
}
3435
}

‎test/TensorFlowNET.Examples/IExample.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
namespace TensorFlowNET.Examples
66
{
7+
/// <summary>
8+
/// Interface of Example project
9+
/// All example should implement IExample so the entry program will find it.
10+
/// </summary>
711
public interface IExample
812
{
913
void Run();

0 commit comments

Comments
 (0)