Browse Source

upgrade NumSharp to v0.10.4.

tags/v0.10
Oceania2018 6 years ago
parent
commit
ed15b2450e
7 changed files with 10 additions and 15 deletions
  1. +1
    -1
      src/TensorFlowNET.Core/Keras/BackendBase.cs
  2. BIN
      src/TensorFlowNET.Core/Open.snk
  3. +1
    -1
      src/TensorFlowNET.Core/Sessions/_FetchMapper.cs
  4. +4
    -9
      src/TensorFlowNET.Core/TensorFlowNET.Core.csproj
  5. +1
    -1
      src/TensorFlowNET.Core/Tensors/TensorShape.cs
  6. +1
    -1
      test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionRNN.cs
  7. +2
    -2
      test/TensorFlowNET.UnitTest/PythonTest.cs

+ 1
- 1
src/TensorFlowNET.Core/Keras/BackendBase.cs View File

@@ -37,7 +37,7 @@ namespace Tensorflow.Keras


public void set_floatx(TF_DataType floatx) => _FLOATX = floatx; 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; public ImageDataFormat image_data_format() => _IMAGE_DATA_FORMAT;




BIN
src/TensorFlowNET.Core/Open.snk View File


+ 1
- 1
src/TensorFlowNET.Core/Sessions/_FetchMapper.cs View File

@@ -42,7 +42,7 @@ namespace Tensorflow
{ {
var type = values[0].GetType(); var type = values[0].GetType();
var nd = new NDArray(type, values.Count); var nd = new NDArray(type, values.Count);
nd.SetData(values.ToArray());
nd.ReplaceData(values.ToArray());
return nd; return nd;
} }




+ 4
- 9
src/TensorFlowNET.Core/TensorFlowNET.Core.csproj View File

@@ -5,7 +5,7 @@
<AssemblyName>TensorFlow.NET</AssemblyName> <AssemblyName>TensorFlow.NET</AssemblyName>
<RootNamespace>Tensorflow</RootNamespace> <RootNamespace>Tensorflow</RootNamespace>
<TargetTensorFlow>1.14.0</TargetTensorFlow> <TargetTensorFlow>1.14.0</TargetTensorFlow>
<Version>0.10.0-alpha</Version>
<Version>0.10.0-beta</Version>
<Authors>Haiping Chen, Meinrad Recheis</Authors> <Authors>Haiping Chen, Meinrad Recheis</Authors>
<Company>SciSharp STACK</Company> <Company>SciSharp STACK</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -29,6 +29,8 @@ Learn more about .NET AI: https://medium.com/scisharp</Description>
<FileVersion>0.10.0.0</FileVersion> <FileVersion>0.10.0.0</FileVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile> <PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Open.snk</AssemblyOriginatorKeyFile>
</PropertyGroup> </PropertyGroup>


<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -60,7 +62,7 @@ Learn more about .NET AI: https://medium.com/scisharp</Description>


<ItemGroup> <ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.9.0" /> <PackageReference Include="Google.Protobuf" Version="3.9.0" />
<PackageReference Include="NumSharp" Version="0.10.3" />
<PackageReference Include="NumSharp" Version="0.10.4" />
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.14.0" /> <PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.14.0" />
</ItemGroup> </ItemGroup>


@@ -68,11 +70,4 @@ Learn more about .NET AI: https://medium.com/scisharp</Description>
<Folder Include="Distribute\" /> <Folder Include="Distribute\" />
<Folder Include="Keras\Initializers\" /> <Folder Include="Keras\Initializers\" />
</ItemGroup> </ItemGroup>

<ItemGroup>
<Reference Include="NumSharp.Core">
<HintPath>..\..\..\..\NumSharp\src\NumSharp.Core\bin\Debug\netstandard2.0\NumSharp.Core.dll</HintPath>
</Reference>
</ItemGroup>

</Project> </Project>

+ 1
- 1
src/TensorFlowNET.Core/Tensors/TensorShape.cs View File

@@ -16,7 +16,7 @@ namespace Tensorflow
{ {
if (proto.UnknownRank) return; 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) public TensorShape(params int[] dims) : base(dims)


+ 1
- 1
test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionRNN.cs View File

@@ -30,7 +30,7 @@ namespace TensorFlowNET.Examples.ImageProcess
/// </summary> /// </summary>
public class DigitRecognitionRNN : IExample public class DigitRecognitionRNN : IExample
{ {
public bool Enabled { get; set; } = true;
public bool Enabled { get; set; } = false;
public bool IsImportingGraph { get; set; } = false; public bool IsImportingGraph { get; set; } = false;


public string Name => "MNIST RNN"; public string Name => "MNIST RNN";


+ 2
- 2
test/TensorFlowNET.UnitTest/PythonTest.cs View File

@@ -42,7 +42,7 @@ namespace TensorFlowNET.UnitTest
for (int i = 0; i < e.Length; i++) for (int i = 0; i < e.Length; i++)
{ {
if (g[i] is NDArray && e[i] is NDArray) 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<object>(), (e[i] as NDArray).GetData<object>());
else if (e[i] is ICollection && g[i] is ICollection) else if (e[i] is ICollection && g[i] is ICollection)
assertEqual(g[i], e[i]); assertEqual(g[i], e[i]);
else else
@@ -60,7 +60,7 @@ namespace TensorFlowNET.UnitTest
{ {
if (given is NDArray && expected is NDArray) if (given is NDArray && expected is NDArray)
{ {
assertItemsEqual((given as NDArray).Array, (expected as NDArray).Array);
assertItemsEqual((given as NDArray).GetData<object>(), (expected as NDArray).GetData<object>());
return; return;
} }
if (given is Hashtable && expected is Hashtable) if (given is Hashtable && expected is Hashtable)


Loading…
Cancel
Save