8000 Release v0.60.2, change to .net standard 2.0. · eLDoherty/TensorFlow.NET@e10e280 · GitHub
[go: up one dir, main page]

Skip to content

Commit e10e280

Browse files
committed
Release v0.60.2, change to .net standard 2.0.
1 parent cb4b248 commit e10e280

File tree

9 files changed

+26
-25
lines changed

9 files changed

+26
-25
lines changed

src/TensorFlowNET.Core/NumPy/AutoNumPyAttribute.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
using System;
33
using System.Collections.Generic;
44
using System.Diagnostics;
5-
using System.Linq;
6-
using Tensorflow.Eager;
7-
using Tensorflow.Functions;
85
using static Tensorflow.Binding;
96

107
namespace Tensorflow.NumPy

src/TensorFlowNET.Core/Operations/array_ops.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ public static Tensor[] meshgrid<T>(T[] array, bool copy = true, bool sparse = fa
798798
var output = new List<Tensor>();
799799
foreach (var (i, x) in enumerate(array))
800800
{
801-
var shape = s0[..i].concat(new[] { -1 }).concat(s0[(i + 1)..]);
801+
var shape = s0.Take(i).ToArray().concat(new[] { -1 }).concat(s0.Skip(i + 1).ToArray());
802802
output.add(reshape(stack(x), shape));
803803
}
804804

src/TensorFlowNET.Core/Operations/linalg_ops.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Linq;
23
using static Tensorflow.Binding;
34

45
namespace Tensorflow
@@ -53,7 +54,7 @@ public Tensor matrix_solve_ls(Tensor matrix, Tensor rhs,
5354

5455
Tensor _composite_impl(Tensor matrix, Tensor rhs, Tensor l2_regularizer = null)
5556
{
56-
Shape matrix_shape = matrix.shape[^2..];
57+
Shape matrix_shape = matrix.shape.dims.Skip(matrix.shape.ndim - 2).ToArray();
5758
if (matrix_shape.IsFullyDefined)
5859
{
5960
if (matrix_shape[-2] >= matrix_shape[-1])
@@ -88,7 +89,7 @@ Tensor _RegularizedGramianCholesky(Tensor matrix, Tensor l2_regularizer, bool fi
8889
var small_dim = first_kind ? matrix_shape[-1] : matrix_shape[-2];
8990
var identity = eye(small_dim.numpy(), batch_shape: batch_shape.shape, dtype: matrix.dtype);
9091
var small_dim_static = matrix.shape[first_kind ? -1 : -2];
91-
identity.shape = matrix.shape[..^2].concat(new[] { small_dim_static, small_dim_static });
92+
identity.shape = matrix.shape.dims.Take(matrix.shape.ndim - 2).ToArray().concat(new[] { small_dim_static, small_dim_static });
9293
gramian += l2_regularizer * identity;
9394
}
9495

src/TensorFlowNET.Core/Tensorflow.Binding.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<AssemblyName>TensorFlow.NET</AssemblyName>
66
<RootNamespace>Tensorflow</RootNamespace>
77
<TargetTensorFlow>2.2.0</TargetTensorFlow>
8-
<Version>0.60.1</Version>
8+
<Version>0.60.2</Version>
99
<LangVersion>9.0</LangVersion>
1010
<Nullable>enable</Nullable>
1111
<Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors>
@@ -20,7 +20,7 @@
2020
<Description>Google's TensorFlow full binding in .NET Standard.
2121
Building, training and infering deep learning models.
2222
https://tensorflownet.readthedocs.io</Description>
23-
<AssemblyVersion>0.60.1.0</AssemblyVersion>
23+
<AssemblyVersion>0.60.2.0</AssemblyVersion>
2424
<PackageReleaseNotes>tf.net 0.60.x and above are based on tensorflow native 2.6.0
2525

2626
* Eager Mode is added finally.
@@ -35,7 +35,7 @@ Keras API is a separate package released as TensorFlow.Keras.
3535
tf.net 0.4x.x aligns with TensorFlow v2.4.1 native library.
3636
tf.net 0.5x.x aligns with TensorFlow v2.5.x native library.
3737
tf.net 0.6x.x aligns with TensorFlow v2.6.x native library.</PackageReleaseNotes>
38-
<FileVersion>0.60.1.0</FileVersion>
38+
<FileVersion>0.60.2.0</FileVersion>
3939
<PackageLicenseFile>LICENSE</PackageLicenseFile>
4040
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
4141
<SignAssembly>true</SignAssembly>
@@ -90,8 +90,8 @@ tf.net 0.6x.x aligns with TensorFlow v2.6.x native library.</PackageReleaseNotes
9090

9191
<ItemGroup>
9292
<PackageReference Include="MethodBoundaryAspect.Fody" Version="2.0.139" />
93-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
93+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
9494
<PackageReference Include="Protobuf.Text" Version="0.5.0" />
95-
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
95+
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0" />
9696
</ItemGroup>
9797
</Project>

src/TensorFlowNET.Keras/Engine/Model.Evaluate.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void evaluate(NDArray x, NDArray y,
6262
}
6363
}
6464

65-
public void evaluate(IDatasetV2 x)
65+
public KeyValuePair<string, float>[] evaluate(IDatasetV2 x)
6666
{
6767
data_handler = new DataHandler(new DataHandlerArgs
6868
{
@@ -72,19 +72,21 @@ public void evaluate(IDatasetV2 x)
7272
});
7373

7474
Binding.tf_output_redirect.WriteLine($"Testing...");
75+
IEnumerable<(string, Tensor)> logs = null;
7576
foreach (var (epoch, iterator) in data_handler.enumerate_epochs())
7677
{
7778
reset_metrics();
7879
// callbacks.on_epoch_begin(epoch)
7980
// data_handler.catch_stop_iteration();
80-
IEnumerable<(string, Tensor)> results = null;
81+
8182
foreach (var step in data_handler.steps())
8283
{
8384
// callbacks.on_train_batch_begin(step)
84-
results = test_function(iterator);
85+
logs = test_function(iterator);
8586
}
86-
Binding.tf_output_redirect.WriteLine($"iterator: {epoch + 1}, " + string.Join(", ", results.Select(x => $"{x.Item1}: {(float)x.Item2}")));
87+
Binding.tf_output_redirect.WriteLine($"iterator: {epoch + 1}, " + string.Join(", ", logs.Select(x => $"{x.Item1}: {(float)x.Item2}")));
8788
}
89+
return logs.Select(x => new KeyValuePair<string, float>(x.Item1, (float)x.Item2)).ToArray();
8890
}
8991

9092
IEnumerable<(string, Tensor)> test_function(OwnedIterator iterator)

src/TensorFlowNET.Keras/Layers/StackedRNNCells.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public object output_size
5151
}
5252
else if (RNN._is_multiple_state(lastCell.state_size))
5353
{
54-
return ((dynamic)Cells[-1].state_size)[0];
54+
// return ((dynamic)Cells[-1].state_size)[0];
55+
throw new NotImplementedException("");
5556
}
5657
else
5758
{

src/TensorFlowNET.Keras/Tensorflow.Keras.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<AssemblyName>Tensorflow.Keras</AssemblyName>
66
<LangVersion>9.0</LangVersion>
77
<Nullable>enable</Nullable>
88
<RootNamespace>Tensorflow.Keras</RootNamespace>
99
<Platforms>AnyCPU;x64</Platforms>
10-
<Version>0.6.1</Version>
10+
<Version>0.6.2</Version>
1111
<Authors>Haiping Chen</Authors>
1212
<Product>Keras for .NET</Product>
1313
<Copyright>Apache 2.0, Haiping Chen 2021</Copyright>
@@ -37,8 +37,8 @@ Keras is an API designed for human beings, not machines. Keras follows best prac
3737
<RepositoryType>Git</RepositoryType>
3838
<SignAssembly>true</SignAssembly>
3939
<AssemblyOriginatorKeyFile>Open.snk</AssemblyOriginatorKeyFile>
40-
<AssemblyVersion>0.6.1.0</AssemblyVersion>
41-
<FileVersion>0.6.1.0</FileVersion>
40+
<AssemblyVersion>0.6.2.0</AssemblyVersion>
41+
<FileVersion>0.6.2.0</FileVersion>
4242
<PackageLicenseFi E377 le>LICENSE</PackageLicenseFile>
4343
</PropertyGroup>
4444

src/TensorFlowNET.Recommenders/Tensorflow.Recommenders.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<Version>0.0.1</Version>
66
<Description>TensorFlow Recommenders is a library for building recommender system models using TensorFlow.</Description>
77
<PackageLicenseFile>LICENSE</PackageLicenseFile>

src/TensorFlowNET.Text/Tensorflow.Text.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<RootNamespace>Tensorflow.Text</RootNamespace>
66
<AssemblyName>Tensorflow.Text</AssemblyName>
77
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

0 commit comments

Comments
 (0)
0