From ed15b2450ef251a0e48a79ba1efb49f1927091e7 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 17 Jul 2019 22:23:22 -0500 Subject: [PATCH] upgrade NumSharp to v0.10.4. --- src/TensorFlowNET.Core/Keras/BackendBase.cs | 2 +- src/TensorFlowNET.Core/Open.snk | Bin 0 -> 596 bytes src/TensorFlowNET.Core/Sessions/_FetchMapper.cs | 2 +- src/TensorFlowNET.Core/TensorFlowNET.Core.csproj | 13 ++++--------- src/TensorFlowNET.Core/Tensors/TensorShape.cs | 2 +- .../ImageProcessing/DigitRecognitionRNN.cs | 2 +- test/TensorFlowNET.UnitTest/PythonTest.cs | 4 ++-- 7 files changed, 10 insertions(+), 15 deletions(-) create mode 100644 src/TensorFlowNET.Core/Open.snk diff --git a/src/TensorFlowNET.Core/Keras/BackendBase.cs b/src/TensorFlowNET.Core/Keras/BackendBase.cs index df04d138..8bd5dd08 100644 --- a/src/TensorFlowNET.Core/Keras/BackendBase.cs +++ b/src/TensorFlowNET.Core/Keras/BackendBase.cs @@ -37,7 +37,7 @@ namespace Tensorflow.Keras public void set_floatx(TF_DataType floatx) => _FLOATX = floatx; - public NDArray cast_to_floatx(NDArray x) => np.array(x, dtype: _FLOATX.as_numpy_datatype()); + //public NDArray cast_to_floatx(NDArray x) => np.array(x, dtype: _FLOATX.as_numpy_datatype()); public ImageDataFormat image_data_format() => _IMAGE_DATA_FORMAT; diff --git a/src/TensorFlowNET.Core/Open.snk b/src/TensorFlowNET.Core/Open.snk new file mode 100644 index 0000000000000000000000000000000000000000..22a3cbd253a7f1091078ac81eb16eb2ffd32880c GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096?hQ!NwRGT!qwi-Ja0OC9TwX^Iw0CWTu zHmBpu*?(UI&ku!hRj87VswwOJ5zo7=JEso*r@f;hY-)`+3QW@j_Y_ELZoDE{g{C-1 z9&Yt<%#x&GJOH@*W!4%#X z>O=LYCI9oV9(*3OvX<8KOfn^kauKMK)Q40Ck2iNzf(#`9!BGFmecB2~ccY%9L3QBBe zG%-a6fU%je)>Y8T3}#BFs84D=?*xidlht=JZr@^(#S^o(LP3+g}r|MD4BH`p~&~6 zt~;;|=bt(1I3jtmbU;6+`22n#0nqha;uK51JVJW88+KQpHUsg+5ZCZ{4D~-qSw{)8 ixNldK-pEwZArM>aiB7nKifAJOwbkQ2Qk0=;PvjC{`6;si literal 0 HcmV?d00001 diff --git a/src/TensorFlowNET.Core/Sessions/_FetchMapper.cs b/src/TensorFlowNET.Core/Sessions/_FetchMapper.cs index 9dc2f50c..7ebd8984 100644 --- a/src/TensorFlowNET.Core/Sessions/_FetchMapper.cs +++ b/src/TensorFlowNET.Core/Sessions/_FetchMapper.cs @@ -42,7 +42,7 @@ namespace Tensorflow { var type = values[0].GetType(); var nd = new NDArray(type, values.Count); - nd.SetData(values.ToArray()); + nd.ReplaceData(values.ToArray()); return nd; } diff --git a/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj b/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj index 04f4f1e7..79c718a2 100644 --- a/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj +++ b/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj @@ -5,7 +5,7 @@ TensorFlow.NET Tensorflow 1.14.0 - 0.10.0-alpha + 0.10.0-beta Haiping Chen, Meinrad Recheis SciSharp STACK true @@ -29,6 +29,8 @@ Learn more about .NET AI: https://medium.com/scisharp 0.10.0.0 LICENSE false + true + Open.snk @@ -60,7 +62,7 @@ Learn more about .NET AI: https://medium.com/scisharp - + @@ -68,11 +70,4 @@ Learn more about .NET AI: https://medium.com/scisharp - - - - ..\..\..\..\NumSharp\src\NumSharp.Core\bin\Debug\netstandard2.0\NumSharp.Core.dll - - - diff --git a/src/TensorFlowNET.Core/Tensors/TensorShape.cs b/src/TensorFlowNET.Core/Tensors/TensorShape.cs index 732e0a4e..e543fc9b 100644 --- a/src/TensorFlowNET.Core/Tensors/TensorShape.cs +++ b/src/TensorFlowNET.Core/Tensors/TensorShape.cs @@ -16,7 +16,7 @@ namespace Tensorflow { if (proto.UnknownRank) return; - ReShape(proto.Dim.Select(x => (int)x.Size).ToArray()); + Reshape(proto.Dim.Select(x => (int)x.Size).ToArray()); } public TensorShape(params int[] dims) : base(dims) diff --git a/test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionRNN.cs b/test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionRNN.cs index 7449ba42..d7cdfb32 100644 --- a/test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionRNN.cs +++ b/test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionRNN.cs @@ -30,7 +30,7 @@ namespace TensorFlowNET.Examples.ImageProcess /// public class DigitRecognitionRNN : IExample { - public bool Enabled { get; set; } = true; + public bool Enabled { get; set; } = false; public bool IsImportingGraph { get; set; } = false; public string Name => "MNIST RNN"; diff --git a/test/TensorFlowNET.UnitTest/PythonTest.cs b/test/TensorFlowNET.UnitTest/PythonTest.cs index 9c08b73d..7bf45840 100644 --- a/test/TensorFlowNET.UnitTest/PythonTest.cs +++ b/test/TensorFlowNET.UnitTest/PythonTest.cs @@ -42,7 +42,7 @@ namespace TensorFlowNET.UnitTest for (int i = 0; i < e.Length; i++) { if (g[i] is NDArray && e[i] is NDArray) - assertItemsEqual((g[i] as NDArray).Array, (e[i] as NDArray).Array); + assertItemsEqual((g[i] as NDArray).GetData(), (e[i] as NDArray).GetData()); else if (e[i] is ICollection && g[i] is ICollection) assertEqual(g[i], e[i]); else @@ -60,7 +60,7 @@ namespace TensorFlowNET.UnitTest { if (given is NDArray && expected is NDArray) { - assertItemsEqual((given as NDArray).Array, (expected as NDArray).Array); + assertItemsEqual((given as NDArray).GetData(), (expected as NDArray).GetData()); return; } if (given is Hashtable && expected is Hashtable)