Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test/TensorFlowNET.Examples/HelloWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ public void Run()
The value returned by the constructor represents the output
of the Constant op. */
var hello = tf.constant("Hello, TensorFlow!");
var str = "Hello, TensorFlow!";
var hello = tf.constant(str);

// Start tf session
using (var sess = tf.Session())
{
// Run the op
var result = sess.run(hello);
Console.WriteLine(result.ToString());
if(!result.ToString().Equals("Hello, TensorFlow!"))
if(!result.ToString().Equals(str))
{
throw new ValueError("HelloWorld");
throw new ValueError("HelloWorld example acts in unexpected way.");
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions test/TensorFlowNET.Examples/IExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

namespace TensorFlowNET.Examples
{
/// <summary>
/// Interface of Example project
/// All example should implement IExample so the entry program will find it.
/// </summary>
public interface IExample
{
void Run();
Expand Down