@@ -2,7 +2,7 @@ | |||||
<PropertyGroup> | <PropertyGroup> | ||||
<OutputType>Exe</OutputType> | <OutputType>Exe</OutputType> | ||||
<TargetFramework>net5.0</TargetFramework> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<RootNamespace>Tensorflow</RootNamespace> | <RootNamespace>Tensorflow</RootNamespace> | ||||
<AssemblyName>Tensorflow</AssemblyName> | <AssemblyName>Tensorflow</AssemblyName> | ||||
<Platforms>AnyCPU;x64</Platforms> | <Platforms>AnyCPU;x64</Platforms> | ||||
@@ -90,9 +90,8 @@ namespace Tensorflow.NumPy | |||||
int total = 1; | int total = 1; | ||||
for (int i = 0; i < shape.Length; i++) | for (int i = 0; i < shape.Length; i++) | ||||
total *= shape[i]; | total *= shape[i]; | ||||
var buffer = new byte[bytes * total]; | |||||
reader.Read(buffer, 0, buffer.Length); | |||||
var buffer = reader.ReadBytes(bytes * total); | |||||
System.Buffer.BlockCopy(buffer, 0, matrix, 0, buffer.Length); | System.Buffer.BlockCopy(buffer, 0, matrix, 0, buffer.Length); | ||||
return matrix; | return matrix; | ||||
@@ -5,7 +5,7 @@ | |||||
<AssemblyName>Tensorflow.Binding</AssemblyName> | <AssemblyName>Tensorflow.Binding</AssemblyName> | ||||
<RootNamespace>Tensorflow</RootNamespace> | <RootNamespace>Tensorflow</RootNamespace> | ||||
<TargetTensorFlow>2.2.0</TargetTensorFlow> | <TargetTensorFlow>2.2.0</TargetTensorFlow> | ||||
<Version>0.70.1</Version> | |||||
<Version>0.70.2</Version> | |||||
<LangVersion>9.0</LangVersion> | <LangVersion>9.0</LangVersion> | ||||
<Nullable>enable</Nullable> | <Nullable>enable</Nullable> | ||||
<Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors> | <Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors> | ||||
@@ -2,7 +2,7 @@ | |||||
<PropertyGroup> | <PropertyGroup> | ||||
<OutputType>Exe</OutputType> | <OutputType>Exe</OutputType> | ||||
<TargetFramework>net5.0</TargetFramework> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<Platforms>AnyCPU;x64</Platforms> | <Platforms>AnyCPU;x64</Platforms> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
@@ -1,7 +1,7 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
<TargetFramework>net5.0</TargetFramework> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<LangVersion>9.0</LangVersion> | <LangVersion>9.0</LangVersion> | ||||
<IsPackable>false</IsPackable> | <IsPackable>false</IsPackable> | ||||
<AssemblyName>TensorFlowNET.UnitTest</AssemblyName> | <AssemblyName>TensorFlowNET.UnitTest</AssemblyName> | ||||
@@ -1,7 +1,7 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
<TargetFramework>net5.0</TargetFramework> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<IsPackable>false</IsPackable> | <IsPackable>false</IsPackable> | ||||
@@ -1,7 +1,7 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
<TargetFramework>net5.0</TargetFramework> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<IsPackable>false</IsPackable> | <IsPackable>false</IsPackable> | ||||
@@ -77,5 +77,16 @@ namespace TensorFlowNET.UnitTest.ManagedAPI | |||||
Assert.AreEqual(c.shape.ndim, 0); | Assert.AreEqual(c.shape.ndim, 0); | ||||
Assert.AreEqual(c.numpy(), 8); | Assert.AreEqual(c.numpy(), 8); | ||||
} | } | ||||
[TestMethod] | |||||
public void Matmul() | |||||
{ | |||||
var a = tf.constant(new[] { 1, 2, 3, 4, 5, 6 }, shape: (2, 3)); | |||||
var b = tf.constant(new[] { 7, 8, 9, 10, 11, 12 }, shape: (3, 2)); | |||||
var c = tf.linalg.matmul(a, b); | |||||
Assert.AreEqual(c.shape, (2, 2)); | |||||
AssetSequenceEqual(c.ToArray<int>(), new[] { 58, 64, 139, 154 }); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,7 +1,7 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
<TargetFramework>net5.0</TargetFramework> | |||||
<TargetFramework>net6.0</TargetFramework> | |||||
<IsPackable>false</IsPackable> | <IsPackable>false</IsPackable> | ||||