| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a8a0731 commit d5534d2
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,6 +14,8 @@ You may obtain a copy of the License at | |||
| 14 | 14 | limitations under the License. | |
| 15 | 15 | ******************************************************************************/ | |
| 16 | 16 | ||
| 17 | + using NumSharp; | ||
| 18 | + | ||
| 17 | 19 | namespace Tensorflow | |
| 18 | 20 | { | |
| 19 | 21 | /// <summary> | |
@@ -27,5 +29,6 @@ public interface ITensorOrOperation | |||
| 27 | 29 | string name { get; } | |
| 28 | 30 | TF_DataType dtype { get; } | |
| 29 | 31 | Tensor[] outputs { get; } | |
| 32 | + NDArray numpy(); | ||
| 30 | 33 | } | |
| 31 | 34 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,7 @@ limitations under the License. | |||
| 15 | 15 | ******************************************************************************/ | |
| 16 | 16 | ||
| 17 | 17 | using Google.Protobuf.Collections; | |
| 18 | + using NumSharp; | ||
| 18 | 19 | using System; | |
| 19 | 20 | using System.Collections.Generic; | |
| 20 | 21 | using System.IO; | |
@@ -322,5 +323,7 @@ public TF_Input _tf_input(int input_idx) | |||
| 322 | 323 | { | |
| 323 | 324 | return new TF_Input(op, input_idx); | |
| 324 | 325 | } | |
| 326 | + | ||
| 327 | + public NDArray numpy() => throw new NotImplementedException(""); | ||
| 325 | 328 | } | |
| 326 | 329 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,11 +75,11 @@ public void Save1() | |||
| 75 | 75 | ||
| 76 | 76 | public void Save2() | |
| 77 | 77 | { | |
| 78 | - var v1 = tf.get_variable("v1", shape: new TensorShape(3), initializer: tf.zeros_initializer); | ||
| 79 | - var v2 = tf.get_variable("v2", shape: new TensorShape(5), initializer: tf.zeros_initializer); | ||
| 78 | + var v1 = tf.compat.v1.get_variable("v1", shape: new TensorShape(3), initializer: tf.zeros_initializer); | ||
| 79 | + var v2 = tf.compat.v1.get_variable("v2", shape: new TensorShape(5), initializer: tf.zeros_initializer); | ||
| 80 | 80 | ||
| 81 | - var inc_v1 = v1.assign(v1 + 1.0f); | ||
| 82 | - var dec_v2 = v2.assign(v2 - 1.0f); | ||
| 81 | + var inc_v1 = v1.assign(v1.AsTensor() + 1.0f); | ||
| 82 | + var dec_v2 = v2.assign(v2.AsTensor() - 1.0f); | ||
| 83 | 83 | ||
| 84 | 84 | // Add an op to initialize the variables. | |
| 85 | 85 | var init_op = tf.global_variables_initializer(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | namespace TensorFlowNET.UnitTest | |
| 14 | 14 | { | |
| 15 | - [TestClass] | ||
| 15 | + [TestClass, Ignore] | ||
| 16 | 16 | public class MultithreadingTests : GraphModeTestBase | |
| 17 | 17 | { | |
| 18 | 18 | [TestMethod] | |
| Back | FazBrowse Home | New Git URL |
0 commit comments