FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix compile failed. · MSavameri/TensorFlow.NET@d5534d2 · GitHub

Repository navigation

Commit d5534d2

Browse files
committed
fix compile failed.
1 parent a8a0731 commit d5534d2

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎src/TensorFlowNET.Core/Interfaces/ITensorOrOperation.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
******************************************************************************/
1616

17+
using NumSharp;
18+
1719
namespace Tensorflow
1820
{
1921
/// <summary>
@@ -27,5 +29,6 @@ public interface ITensorOrOperation
2729
string name { get; }
2830
TF_DataType dtype { get; }
2931
Tensor[] outputs { get; }
32+
NDArray numpy();
3033
}
3134
}

‎src/TensorFlowNET.Core/Operations/Operation.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ limitations under the License.
1515
******************************************************************************/
1616

1717
using Google.Protobuf.Collections;
18+
using NumSharp;
1819
using System;
1920
using System.Collections.Generic;
2021
using System.IO;
@@ -322,5 +323,7 @@ public TF_Input _tf_input(int input_idx)
322323
{
323324
return new TF_Input(op, input_idx);
324325
}
326+
327+
public NDArray numpy() => throw new NotImplementedException("");
325328
}
326329
}

‎test/TensorFlowNET.UnitTest/Basics/TrainSaverTest.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ public void Save1()
7575

7676
public void Save2()
7777
{
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);
8080

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);
8383

8484
// Add an op to initialize the variables.
8585
var init_op = tf.global_variables_initializer();

‎test/TensorFlowNET.UnitTest/MultithreadingTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace TensorFlowNET.UnitTest
1414
{
15-
[TestClass]
15+
[TestClass, Ignore]
1616
public class MultithreadingTests : GraphModeTestBase
1717
{
1818
[TestMethod]

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL