You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Tensorflow;
-
- namespace TensorFlowNET.Examples
- {
- /// <summary>
- /// Basic Operations example using TensorFlow library.
- /// https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/1_Introduction/basic_operations.py
- /// </summary>
- public class BasicOperations : IExample
- {
- public void Run()
- {
- // Basic constant operations
- // The value returned by the constructor represents the output
- // of the Constant op.
- var a = tf.constant(2);
- var b = tf.constant(3);
- var c = a * b;
- // Launch the default graph.
- using (var sess = tf.Session())
- {
- Console.WriteLine("a=2, b=3");
- Console.WriteLine($"Addition with constants: {sess.run(a + b)}");
- Console.WriteLine($"Multiplication with constants: {sess.run(a * b)}");
- }
- }
- }
- }
|