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 Microsoft.VisualStudio.TestTools.UnitTesting;
- using System.Linq;
- using Tensorflow;
- using static Tensorflow.Binding;
-
- namespace TensorFlowNET.UnitTest.Basics
- {
- [TestClass]
- public class VariableTest : GraphModeTestBase
- {
- [TestMethod]
- public void InitVariable()
- {
- var v = tf.Variable(new[] { 1, 2 });
- var init = tf.compat.v1.global_variables_initializer();
-
- var sess = tf.compat.v1.Session();
- sess.run(init);
- // Usage passing the session explicitly.
- print(v.eval(sess));
- // Usage with the default session. The 'with' block
- // above makes 'sess' the default session.
- print(v.eval());
- }
- }
- }
|