Skip to content

Commit 887cebb

Browse files
Working on adding tf support. Using tf.kers 2.12 APIs for building
1 parent 2ea442d commit 887cebb

File tree

6 files changed

+61
-5
lines changed

6 files changed

+61
-5
lines changed

Keras.NET.sln

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29123.88
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33502.453
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Keras.UnitTest", "Keras.UnitTest\Keras.UnitTest.csproj", "{0B402B43-29A2-4564-BC20-20BBBE7C2C51}"
77
EndProject
@@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KerasExampleWinApp", "Examp
2323
EndProject
2424
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MusicGeneration", "Examples\MusicGeneration\MusicGeneration.csproj", "{108C3326-58D2-4C26-9D78-5F045D620A26}"
2525
EndProject
26+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tensorflow", "Tensorflow\Tensorflow.csproj", "{27230C96-FCB4-406C-8AAD-450020F9074D}"
27+
EndProject
2628
Global
2729
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2830
Debug|Any CPU = Debug|Any CPU
@@ -317,6 +319,38 @@ Global
317319
{108C3326-58D2-4C26-9D78-5F045D620A26}.Release|Any CPU.Build.0 = Release|Any CPU
318320
{108C3326-58D2-4C26-9D78-5F045D620A26}.Release|x64.ActiveCfg = Release|Any CPU
319321
{108C3326-58D2-4C26-9D78-5F045D620A26}.Release|x64.Build.0 = Release|Any CPU
322+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
323+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Debug|Any CPU.Build.0 = Debug|Any CPU
324+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Debug|x64.ActiveCfg = Debug|Any CPU
325+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Debug|x64.Build.0 = Debug|Any CPU
326+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_Mono|Any CPU.ActiveCfg = Debug|Any CPU
327+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_Mono|Any CPU.Build.0 = Debug|Any CPU
328+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_Mono|x64.ActiveCfg = Debug|Any CPU
329+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_Mono|x64.Build.0 = Debug|Any CPU
330+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_OSX|Any CPU.ActiveCfg = Debug|Any CPU
331+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_OSX|Any CPU.Build.0 = Debug|Any CPU
332+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_OSX|x64.ActiveCfg = Debug|Any CPU
333+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_OSX|x64.Build.0 = Debug|Any CPU
334+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_WIN|Any CPU.ActiveCfg = Debug|Any CPU
335+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_WIN|Any CPU.Build.0 = Debug|Any CPU
336+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_WIN|x64.ActiveCfg = Debug|Any CPU
337+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_WIN|x64.Build.0 = Debug|Any CPU
338+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_Mono|Any CPU.ActiveCfg = Debug|Any CPU
339+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_Mono|Any CPU.Build.0 = Debug|Any CPU
340+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_Mono|x64.ActiveCfg = Debug|Any CPU
341+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_Mono|x64.Build.0 = Debug|Any CPU
342+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_OSX|Any CPU.ActiveCfg = Debug|Any CPU
343+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_OSX|Any CPU.Build.0 = Debug|Any CPU
344+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_OSX|x64.ActiveCfg = Debug|Any CPU
345+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_OSX|x64.Build.0 = Debug|Any CPU
346+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_WIN|Any CPU.ActiveCfg = Debug|Any CPU
347+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_WIN|Any CPU.Build.0 = Debug|Any CPU
348+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_WIN|x64.ActiveCfg = Debug|Any CPU
349+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_WIN|x64.Build.0 = Debug|Any CPU
350+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Release|Any CPU.ActiveCfg = Release|Any CPU
351+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Release|Any CPU.Build.0 = Release|Any CPU
352+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Release|x64.ActiveCfg = Release|Any CPU
353+
{27230C96-FCB4-406C-8AAD-450020F9074D}.Release|x64.Build.0 = Release|Any CPU
320354
EndGlobalSection
321355
GlobalSection(SolutionProperties) = preSolution
322356
HideSolutionNode = FALSE

Keras/Keras.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
</ItemGroup>
3939

4040
<ItemGroup>
41+
<Folder Include="tf\" />
4142
<Folder Include="Properties\"></Folder>
4243
</ItemGroup>
4344

Keras/Layers/Core.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class Input : BaseLayer
2020
/// <param name="dtype">The data type expected by the input, as a string (float32, float64, int32...)</param>
2121
/// <param name="sparse"> A boolean specifying whether the placeholder to be created is sparse.</param>
2222
/// <param name="tensor">Optional existing tensor to wrap into the Input layer. If set, the layer will not create a placeholder tensor.</param>
23-
public Input(Shape shape, Shape batch_shape = null, string name = "", string dtype = "float32", bool sparse = false, NDarray tensor = null)
23+
public Input(Shape shape, Shape batch_shape = null, string name = "", string dtype = "float32", bool sparse = false, NDarray tensor = null, bool? ragged = null)
2424
{
2525
this["shape"] = shape;
2626
this["batch_shape"] = batch_shape;

Keras/Models/Model.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ internal Model(PyObject obj)
3434
/// </summary>
3535
/// <param name="inputs">The inputs layers.</param>
3636
/// <param name="outputs">The outputs layers.</param>
37-
public Model(BaseLayer[] inputs, BaseLayer[] outputs)
37+
/// <param name="name">The layer name.</param>
38+
public Model(BaseLayer[] inputs, BaseLayer[] outputs, string name = null)
3839
{
3940
List<PyObject> inputList = new List<PyObject>();
4041
List<PyObject> outputList = new List<PyObject>();
@@ -49,7 +50,7 @@ public Model(BaseLayer[] inputs, BaseLayer[] outputs)
4950
outputList.Add(item.PyInstance);
5051
}
5152

52-
PyInstance = Instance.keras.models.Model(inputList, outputList);
53+
PyInstance = Instance.keras.models.Model(inputList, outputList, name);
5354
}
5455

5556
/// <summary>

Tensorflow/TensorSpec.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System;
2+
3+
namespace Tensorflow
4+
{
5+
public class TensorSpec
6+
{
7+
8+
}
9+
}

Tensorflow/Tensorflow.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Numpy.Bare" Version="3.11.1.33" />
9+
</ItemGroup>
10+
11+
</Project>

0 commit comments

Comments
 (0)