| @@ -0,0 +1,60 @@ | |||||
| | |||||
| Microsoft Visual Studio Solution File, Format Version 12.00 | |||||
| # Visual Studio Version 16 | |||||
| VisualStudioVersion = 16.0.29102.190 | |||||
| MinimumVisualStudioVersion = 10.0.40219.1 | |||||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1E65784D-C976-4DFF-991A-DD5C57FFC8E2}" | |||||
| ProjectSection(SolutionItems) = preProject | |||||
| scripts\Copy-NativeTensorFlowLibs.ps1 = scripts\Copy-NativeTensorFlowLibs.ps1 | |||||
| EndProjectSection | |||||
| EndProject | |||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "runtime.linux-x64.SciSharp.TensorFlow-Cpu.Redist", "redist\runtime.linux-x64.SciSharp.TensorFlow-Cpu.Redist\runtime.linux-x64.SciSharp.TensorFlow-Cpu.Redist.csproj", "{9834D2B4-01BF-4D18-8DCF-F498AC481FE7}" | |||||
| EndProject | |||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "runtime.linux-x64.SciSharp.TensorFlow-Gpu.Redist", "redist\runtime.linux-x64.SciSharp.TensorFlow-Gpu.Redist\runtime.linux-x64.SciSharp.TensorFlow-Gpu.Redist.csproj", "{9D853997-3143-4F87-B995-7D7024CF4E1A}" | |||||
| EndProject | |||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "runtime.win-x64.SciSharp.TensorFlow-Cpu.Redist", "redist\runtime.win-x64.SciSharp.TensorFlow-Cpu.Redist\runtime.win-x64.SciSharp.TensorFlow-Cpu.Redist.csproj", "{878C1EE4-B945-41BF-98DE-C4747C28022A}" | |||||
| EndProject | |||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist", "redist\runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist\runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist.csproj", "{744A3D51-CEF6-4685-B4C3-718FA61143A0}" | |||||
| EndProject | |||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SciSharp.TensorFlow-Cpu.Redist", "redist\SciSharp.TensorFlow-Cpu.Redist\SciSharp.TensorFlow-Cpu.Redist.csproj", "{0A281E9C-6E3D-4172-84BA-2B5F6E9F4D5B}" | |||||
| EndProject | |||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SciSharp.TensorFlow-Gpu.Redist", "redist\SciSharp.TensorFlow-Gpu.Redist\SciSharp.TensorFlow-Gpu.Redist.csproj", "{1910BE36-82E3-4465-B3B1-788BFD252DB7}" | |||||
| EndProject | |||||
| Global | |||||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||||
| Debug|Any CPU = Debug|Any CPU | |||||
| Release|Any CPU = Release|Any CPU | |||||
| EndGlobalSection | |||||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | |||||
| {9834D2B4-01BF-4D18-8DCF-F498AC481FE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
| {9834D2B4-01BF-4D18-8DCF-F498AC481FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
| {9834D2B4-01BF-4D18-8DCF-F498AC481FE7}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
| {9834D2B4-01BF-4D18-8DCF-F498AC481FE7}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
| {9D853997-3143-4F87-B995-7D7024CF4E1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
| {9D853997-3143-4F87-B995-7D7024CF4E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
| {9D853997-3143-4F87-B995-7D7024CF4E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
| {9D853997-3143-4F87-B995-7D7024CF4E1A}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
| {878C1EE4-B945-41BF-98DE-C4747C28022A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
| {878C1EE4-B945-41BF-98DE-C4747C28022A}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
| {878C1EE4-B945-41BF-98DE-C4747C28022A}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
| {878C1EE4-B945-41BF-98DE-C4747C28022A}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
| {744A3D51-CEF6-4685-B4C3-718FA61143A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
| {744A3D51-CEF6-4685-B4C3-718FA61143A0}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
| {744A3D51-CEF6-4685-B4C3-718FA61143A0}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
| {744A3D51-CEF6-4685-B4C3-718FA61143A0}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
| {0A281E9C-6E3D-4172-84BA-2B5F6E9F4D5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
| {0A281E9C-6E3D-4172-84BA-2B5F6E9F4D5B}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
| {0A281E9C-6E3D-4172-84BA-2B5F6E9F4D5B}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
| {0A281E9C-6E3D-4172-84BA-2B5F6E9F4D5B}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
| {1910BE36-82E3-4465-B3B1-788BFD252DB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
| {1910BE36-82E3-4465-B3B1-788BFD252DB7}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
| {1910BE36-82E3-4465-B3B1-788BFD252DB7}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
| {1910BE36-82E3-4465-B3B1-788BFD252DB7}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
| EndGlobalSection | |||||
| GlobalSection(SolutionProperties) = preSolution | |||||
| HideSolutionNode = FALSE | |||||
| EndGlobalSection | |||||
| GlobalSection(ExtensibilityGlobals) = postSolution | |||||
| SolutionGuid = {CD7D5F34-42AE-4CCB-BDFA-1619B3A84708} | |||||
| EndGlobalSection | |||||
| EndGlobal | |||||
| @@ -0,0 +1,63 @@ | |||||
| <Project Sdk="Microsoft.NET.Sdk"> | |||||
| <PropertyGroup> | |||||
| <TargetFramework>netstandard2.0</TargetFramework> | |||||
| <RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers> | |||||
| <AssemblyName>SciSharp.Tensorflow-Cpu.Redist</AssemblyName> | |||||
| <PackageId>SciSharp.Tensorflow-Cpu.Redist</PackageId> | |||||
| <Version>1.0.0</Version> | |||||
| <Authors>SciSharp team</Authors> | |||||
| <Company>SciSharp STACK</Company> | |||||
| <RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl> | |||||
| <RepositoryType>git</RepositoryType> | |||||
| <Description> | |||||
| Meta-package for GPU Tensoflow library runtime distribution. | |||||
| Libraries can be directly downloaded from https://storage.googleapis.com/tensorflow/libtensorflow/ | |||||
| </Description> | |||||
| <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | |||||
| <PackageProjectUrl>https://github.com/SciSharp/TensorFlow.NET</PackageProjectUrl> | |||||
| <PackageTags>native;tensorflow;machine-learning;ML</PackageTags> | |||||
| <PackageOutputPath>../../packages</PackageOutputPath> | |||||
| <GeneratePackageOnBuild>false</GeneratePackageOnBuild> | |||||
| <EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |||||
| <ProduceReferenceAssembly>false</ProduceReferenceAssembly> | |||||
| <IncludeBuildOutput>false</IncludeBuildOutput> | |||||
| </PropertyGroup> | |||||
| <!-- Need to add some dependencies so Meta-Project will pull runtime Project(s) --> | |||||
| <Target Name="ValidateRuntimePack" BeforeTargets="GenerateNuspec"> | |||||
| <ItemGroup> | |||||
| <RuntimeLinux Include="../../packages/runtime.linux-x64.SciSharp.Tensorflow-Cpu.Redist.*.nupkg" /> | |||||
| <RuntimeWin Include="../../packages/runtime.win-x64.SciSharp.Tensorflow-Cpu.Redist.*.nupkg" /> | |||||
| </ItemGroup> | |||||
| <Message Importance="high" Text="Package runtime.linux-x64.SciSharp.Tensorflow-Cpu.Redist: found" Condition="Exists('@(RuntimeLinux)')" /> | |||||
| <Message Importance="high" Text="Package runtime.linux-x64.SciSharp.Tensorflow-Cpu.Redist: not found" Condition="!Exists('@(RuntimeLinux)')" /> | |||||
| <Message Importance="high" Text="Package runtime.win-x64.SciSharp.Tensorflow-Cpu.Redist: found" Condition="Exists('@(RuntimeWin)')" /> | |||||
| <Message Importance="high" Text="Package runtime.win-x64.SciSharp.Tensorflow-Cpu.Redist: not found" Condition="!Exists('@(RuntimeWin)')" /> | |||||
| <Error Text="You must locally 'dotnet pack' at least one runtime.{rid}.SciSharp.Tensorflow-Cpu.Redist project." Condition="!Exists('@(RuntimeLinux)') AND !Exists('@(RuntimeWin)')" /> | |||||
| </Target> | |||||
| <PropertyGroup> | |||||
| <RestoreSources>../../packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources> | |||||
| </PropertyGroup> | |||||
| <ItemGroup Condition="Exists('../../packages/runtime.linux-x64.SciSharp.Tensorflow-Cpu.Redist.1.0.0.nupkg')"> | |||||
| <PackageReference Include="runtime.linux-x64.SciSharp.Tensorflow-Cpu.Redist" Version="1.0.0" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup Condition="Exists('../../packages/runtime.win-x64.SciSharp.Tensorflow-Cpu.Redist.1.0.0.nupkg')"> | |||||
| <PackageReference Include="runtime.win-x64.SciSharp.Tensorflow-Cpu.Redist" Version="1.0.0" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <RuntimeLinux Include="../../packages/runtime.linux-x64.SciSharp.Tensorflow-Cpu.Redist.*.nupkg" /> | |||||
| <RuntimeWin Include="../../packages/runtime.win-x64.SciSharp.Tensorflow-Cpu.Redist.*.nupkg" /> | |||||
| <Content Include="runtime.json" Condition="Exists('@(RuntimeLinux)') AND Exists('@(RuntimeWin)')"> | |||||
| <PackagePath>runtime.json</PackagePath> | |||||
| <Pack>true</Pack> | |||||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
| </Content> | |||||
| </ItemGroup> | |||||
| </Project> | |||||
| @@ -0,0 +1,14 @@ | |||||
| { | |||||
| "runtimes": { | |||||
| "linux-x64": { | |||||
| "SciSharp.TensorFlow-Gpu.Redist": { | |||||
| "runtime.linux-x64.SciSharp.Tensorflow-Cpu.Redist": "1.0.0" | |||||
| } | |||||
| }, | |||||
| "win-x64": { | |||||
| "SciSharp.TensorFlow-Gpu.Redist": { | |||||
| "runtime.win-x64.SciSharp.Tensorflow-Cpu.Redist": "1.0.0" | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,81 @@ | |||||
| <Project Sdk="Microsoft.NET.Sdk"> | |||||
| <PropertyGroup> | |||||
| <OutputType>Library</OutputType> | |||||
| <TargetFramework>netstandard2.0</TargetFramework> | |||||
| <!-- TensorFlow doesn't support Gpus on Mac Os. --> | |||||
| <RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers> | |||||
| <AssemblyName>SciSharp.Tensorflow-Gpu.Redist</AssemblyName> | |||||
| <PackageId>SciSharp.Tensorflow-Gpu.Redist</PackageId> | |||||
| <Version>1.0.0</Version> | |||||
| <Authors>SciSharp team</Authors> | |||||
| <Company>SciSharp STACK</Company> | |||||
| <RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl> | |||||
| <RepositoryType>git</RepositoryType> | |||||
| <Description> | |||||
| Meta-package for GPU Tensoflow library runtime distribution. | |||||
| Libraries can be directly downloaded from https://storage.googleapis.com/tensorflow/libtensorflow/ | |||||
| </Description> | |||||
| <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | |||||
| <PackageProjectUrl>https://github.com/SciSharp/TensorFlow.NET</PackageProjectUrl> | |||||
| <PackageTags>native;tensorflow;machine-learning;ML</PackageTags> | |||||
| <PackageOutputPath>../../packages</PackageOutputPath> | |||||
| <GeneratePackageOnBuild>false</GeneratePackageOnBuild> | |||||
| <EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |||||
| <ProduceReferenceAssembly>false</ProduceReferenceAssembly> | |||||
| <IncludeBuildOutput>false</IncludeBuildOutput> | |||||
| </PropertyGroup> | |||||
| <!-- Need to add some dependencies so Meta-Project will pull runtime Project(s) --> | |||||
| <Target Name="ValidateRuntimePack" BeforeTargets="GenerateNuspec"> | |||||
| <ItemGroup> | |||||
| <RuntimeLinux Include="../../packages/runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist.*.nupkg" /> | |||||
| <RuntimeWin Include="../../packages/runtime.win-x64.SciSharp.Tensorflow-Gpu.Redist.*.nupkg" /> | |||||
| </ItemGroup> | |||||
| <Message | |||||
| Importance="high" | |||||
| Text="Package runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist: found" | |||||
| Condition="Exists('@(RuntimeLinux)')" /> | |||||
| <Message | |||||
| Importance="high" | |||||
| Text="Package runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist: not found" | |||||
| Condition="!Exists('@(RuntimeLinux)')" /> | |||||
| <Message | |||||
| Importance="high" | |||||
| Text="Package runtime.win-x64.SciSharp.Tensorflow-Gpu.Redist: found" | |||||
| Condition="Exists('@(RuntimeWin)')" /> | |||||
| <Message | |||||
| Importance="high" | |||||
| Text="Package runtime.win-x64.SciSharp.Tensorflow-Gpu.Redist: not found" | |||||
| Condition="!Exists('@(RuntimeWin)')" /> | |||||
| <Error | |||||
| Text="You must locally 'dotnet pack' at least one runtime.{rid}.SciSharp.Tensorflow-Gpu.Redist project." | |||||
| Condition="!Exists('@(RuntimeLinux)') AND !Exists('@(RuntimeWin)')" /> | |||||
| </Target> | |||||
| <PropertyGroup> | |||||
| <RestoreSources>../../packages;$(RestoreSources);https://api.nuget.org/v3/index.json</RestoreSources> | |||||
| </PropertyGroup> | |||||
| <ItemGroup Condition="Exists('../../packages/runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist.1.0.0.nupkg')"> | |||||
| <PackageReference Include="runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist" Version="1.0.0" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup Condition="Exists('../../packages/runtime.win-x64.SciSharp.Tensorflow-Gpu.Redist.1.0.0.nupkg')"> | |||||
| <PackageReference Include="runtime.win-x64.SciSharp.Tensorflow-Gpu.Redist" Version="1.0.0" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <RuntimeLinux Include="../../packages/runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist.*.nupkg" /> | |||||
| <RuntimeWin Include="../../packages/runtime.win-x64.SciSharp.Tensorflow-Gpu.Redist.*.nupkg" /> | |||||
| <Content | |||||
| Include="runtime.json" | |||||
| Condition="Exists('@(RuntimeLinux)') AND Exists('@(RuntimeWin)')"> | |||||
| <PackagePath>runtime.json</PackagePath> | |||||
| <Pack>true</Pack> | |||||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
| </Content> | |||||
| </ItemGroup> | |||||
| </Project> | |||||
| @@ -0,0 +1,14 @@ | |||||
| { | |||||
| "runtimes": { | |||||
| "linux-x64": { | |||||
| "SciSharp.TensorFlow-Gpu.Redist": { | |||||
| "runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist": "1.0.0" | |||||
| } | |||||
| }, | |||||
| "win-x64": { | |||||
| "SciSharp.TensorFlow-Gpu.Redist": { | |||||
| "runtime.win-x64.SciSharp.Tensorflow-Gpu.Redist": "1.0.0" | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,39 @@ | |||||
| <Project Sdk="Microsoft.NET.Sdk"> | |||||
| <PropertyGroup> | |||||
| <TargetFramework>netstandard2.0</TargetFramework> | |||||
| <RuntimeIdentifier>linux-x64</RuntimeIdentifier> | |||||
| <AssemblyName>SciSharp.Tensorflow-Cpu.Redist</AssemblyName> | |||||
| <PackageId>runtime.linux-x64.SciSharp.Tensorflow-Cpu.Redist</PackageId> | |||||
| <Version>1.0.0</Version> | |||||
| <Authors>SciSharp team</Authors> | |||||
| <Company>SciSharp STACK</Company> | |||||
| <RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl> | |||||
| <RepositoryType>git</RepositoryType> | |||||
| <Description> | |||||
| Distribution of the Linux CPU Tensoflow library. | |||||
| The libraries can be directly downloaded from https://storage.googleapis.com/tensorflow/libtensorflow/ | |||||
| </Description> | |||||
| <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | |||||
| <PackageProjectUrl>https://github.com/SciSharp/TensorFlow.NET</PackageProjectUrl> | |||||
| <PackageTags>native;tensorflow;machine-learning;ML</PackageTags> | |||||
| <PackageOutputPath>../../packages</PackageOutputPath> | |||||
| <GeneratePackageOnBuild>false</GeneratePackageOnBuild> | |||||
| <EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |||||
| <ProduceReferenceAssembly>false</ProduceReferenceAssembly> | |||||
| <IncludeBuildOutput>false</IncludeBuildOutput> | |||||
| </PropertyGroup> | |||||
| <ItemGroup> | |||||
| <!-- All dlls will be dropped in a folder available through DllImport.--> | |||||
| <Content Include="*.so.*"> | |||||
| <PackagePath>runtimes/$(RuntimeIdentifier)/native/%(Filename)%(Extension)</PackagePath> | |||||
| <Pack>true</Pack> | |||||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
| </Content> | |||||
| </ItemGroup> | |||||
| </Project> | |||||
| @@ -0,0 +1,40 @@ | |||||
| <Project Sdk="Microsoft.NET.Sdk"> | |||||
| <PropertyGroup> | |||||
| <OutputType>Library</OutputType> | |||||
| <TargetFramework>netstandard2.0</TargetFramework> | |||||
| <RuntimeIdentifier>linux-x64</RuntimeIdentifier> | |||||
| <AssemblyName>SciSharp.Tensorflow-Gpu.Redist</AssemblyName> | |||||
| <PackageId>runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist</PackageId> | |||||
| <Version>1.0.0</Version> | |||||
| <Authors>SciSharp team</Authors> | |||||
| <Company>SciSharp STACK</Company> | |||||
| <RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl> | |||||
| <RepositoryType>git</RepositoryType> | |||||
| <Description> | |||||
| Distribution of the Linux GPU Tensoflow library. | |||||
| Dll can be directly downloaded from https://storage.googleapis.com/tensorflow/libtensorflow/ | |||||
| </Description> | |||||
| <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | |||||
| <PackageProjectUrl>https://github.com/SciSharp/TensorFlow.NET</PackageProjectUrl> | |||||
| <PackageTags>native;tensorflow;machine-learning;ML</PackageTags> | |||||
| <PackageOutputPath>../../packages</PackageOutputPath> | |||||
| <GeneratePackageOnBuild>false</GeneratePackageOnBuild> | |||||
| <EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |||||
| <ProduceReferenceAssembly>false</ProduceReferenceAssembly> | |||||
| <IncludeBuildOutput>false</IncludeBuildOutput> | |||||
| </PropertyGroup> | |||||
| <ItemGroup> | |||||
| <!-- All dlls will be dropped in a folder available through DllImport.--> | |||||
| <Content Include="*.so.*"> | |||||
| <PackagePath>runtimes/$(RuntimeIdentifier)/native/%(Filename)%(Extension)</PackagePath> | |||||
| <Pack>true</Pack> | |||||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
| </Content> | |||||
| </ItemGroup> | |||||
| </Project> | |||||
| @@ -0,0 +1,39 @@ | |||||
| <Project Sdk="Microsoft.NET.Sdk"> | |||||
| <PropertyGroup> | |||||
| <TargetFramework>netstandard2.0</TargetFramework> | |||||
| <RuntimeIdentifier>win-x64</RuntimeIdentifier> | |||||
| <AssemblyName>SciSharp.Tensorflow-Cpu.Redist</AssemblyName> | |||||
| <PackageId>runtime.win-x64.SciSharp.Tensorflow-Cpu.Redist</PackageId> | |||||
| <Version>1.0.0</Version> | |||||
| <Authors>SciSharp team</Authors> | |||||
| <Company>SciSharp STACK</Company> | |||||
| <RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl> | |||||
| <RepositoryType>git</RepositoryType> | |||||
| <Description> | |||||
| Distribution of the windows GPU Tensoflow library. | |||||
| The libraries can be directly downloaded from https://storage.googleapis.com/tensorflow/libtensorflow/ | |||||
| </Description> | |||||
| <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | |||||
| <PackageProjectUrl>https://github.com/SciSharp/TensorFlow.NET</PackageProjectUrl> | |||||
| <PackageTags>native;tensorflow;machine-learning;ML</PackageTags> | |||||
| <PackageOutputPath>../../packages</PackageOutputPath> | |||||
| <GeneratePackageOnBuild>false</GeneratePackageOnBuild> | |||||
| <EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |||||
| <ProduceReferenceAssembly>false</ProduceReferenceAssembly> | |||||
| <IncludeBuildOutput>false</IncludeBuildOutput> | |||||
| </PropertyGroup> | |||||
| <ItemGroup> | |||||
| <!-- All dlls will be dropped in a folder available through DllImport.--> | |||||
| <Content Include="*.dll"> | |||||
| <PackagePath>runtimes/$(RuntimeIdentifier)/native/%(Filename)%(Extension)</PackagePath> | |||||
| <Pack>true</Pack> | |||||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
| </Content> | |||||
| </ItemGroup> | |||||
| </Project> | |||||
| @@ -0,0 +1 @@ | |||||
| tensorflow.dll | |||||
| @@ -0,0 +1,40 @@ | |||||
| <Project Sdk="Microsoft.NET.Sdk"> | |||||
| <PropertyGroup> | |||||
| <OutputType>Library</OutputType> | |||||
| <TargetFramework>netstandard2.0</TargetFramework> | |||||
| <RuntimeIdentifier>win-x64</RuntimeIdentifier> | |||||
| <AssemblyName>SciSharp.Tensorflow-Gpu.Redist</AssemblyName> | |||||
| <PackageId>runtime.win-x64.SciSharp.Tensorflow-Gpu.Redist</PackageId> | |||||
| <Version>1.0.0</Version> | |||||
| <Authors>SciSharp team</Authors> | |||||
| <Company>SciSharp STACK</Company> | |||||
| <RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl> | |||||
| <RepositoryType>git</RepositoryType> | |||||
| <Description> | |||||
| Distribution of the windows GPU Tensoflow library. | |||||
| Dll can be directly downloaded from https://storage.googleapis.com/tensorflow/libtensorflow/ | |||||
| </Description> | |||||
| <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | |||||
| <PackageProjectUrl>https://github.com/SciSharp/TensorFlow.NET</PackageProjectUrl> | |||||
| <PackageTags>native;tensorflow;machine-learning;ML</PackageTags> | |||||
| <PackageOutputPath>../../packages</PackageOutputPath> | |||||
| <GeneratePackageOnBuild>false</GeneratePackageOnBuild> | |||||
| <EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |||||
| <ProduceReferenceAssembly>false</ProduceReferenceAssembly> | |||||
| <IncludeBuildOutput>false</IncludeBuildOutput> | |||||
| </PropertyGroup> | |||||
| <ItemGroup> | |||||
| <!-- All dlls will be dropped in a folder available through DllImport.--> | |||||
| <Content Include="*.dll"> | |||||
| <PackagePath>runtimes/$(RuntimeIdentifier)/native/%(Filename)%(Extension)</PackagePath> | |||||
| <Pack>true</Pack> | |||||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
| </Content> | |||||
| </ItemGroup> | |||||
| </Project> | |||||
| @@ -0,0 +1,167 @@ | |||||
| <# | |||||
| .SYNOPSIS | |||||
| Copy the native TensorFlow library to enable the packing a nuget to make | |||||
| them available to TensorFlow.NET | |||||
| .DESCRIPTION | |||||
| The TensorFlow libraries are copied for Windows and Linux and it becomes | |||||
| possible to bundle a meta-package containing them. | |||||
| .PARAMETER SkipCpuLibraries | |||||
| Setting this to true skips the downloading of the CPU version of the | |||||
| TensorFlow libraries. | |||||
| By default the CPU version of the libraries are downloaded and put in the | |||||
| relevant projects. | |||||
| .PARAMETER SkipGpuLibraries | |||||
| Setting this to tru skips the downloading of the GPU version of the | |||||
| TensorFlow libraries. | |||||
| By default the GPU version of the libraries are downloaded and put in the | |||||
| releavant projects. | |||||
| #> | |||||
| param( | |||||
| [switch] $SkipCpuLibraries = $false, | |||||
| [switch] $SkipGpuLibraries = $false | |||||
| ) | |||||
| function Expand-TarGzFiles { | |||||
| <# | |||||
| .SYNOPSIS | |||||
| Expands the given list of files from the given archive into the given | |||||
| target directory. | |||||
| .PARAMETER Archive | |||||
| Path to the archive that should be considered. | |||||
| .PARAMETER Files | |||||
| Files that should be extracted from the archive. | |||||
| .PARAMETER TargetDirectory | |||||
| Directory into which the files should be expanded. | |||||
| #> | |||||
| param | |||||
| ( | |||||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [string] $Archive, | |||||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [string []] $Files, | |||||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [string] $TargetDirectory | |||||
| ) | |||||
| & 7z e $Archive -o"$TargetDirectory" | |||||
| $TarArchive = Join-Path $TargetDirectory "libtensorflow.tar" | |||||
| & 7z e $TarArchive $Files -o"$TargetDirectory" | |||||
| Remove-Item $TarArchive | |||||
| } | |||||
| function Expand-ZipFiles { | |||||
| <# | |||||
| .SYNOPSIS | |||||
| Expands the given list of files from the given archive into the given target directory. | |||||
| .PARAMETER Archive | |||||
| Path to the archive that should be considered. | |||||
| .PARAMETER Files | |||||
| Files that should be extracted from the archive. | |||||
| .PARAMETER TargetDirectory | |||||
| Directory into which the files should be expanded. | |||||
| #> | |||||
| param( | |||||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [string] $Archive, | |||||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [string []] $Files, | |||||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [string] $TargetDirectory | |||||
| ) | |||||
| & 7z e $Archive $Files -o"$TargetDirectory" | |||||
| } | |||||
| function Split-ArchiveFromUrl { | |||||
| <# | |||||
| .SYNOPSIS | |||||
| Extracts the archive name out of the given Url. | |||||
| .PARAMETER ArchiveUrl | |||||
| Url of the archive that will be downloaded. | |||||
| #> | |||||
| param( | |||||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [string] $ArchiveUrl | |||||
| ) | |||||
| $uriParts = $ArchiveUrl.split("/") | |||||
| $ArchivePath = $uriParts[$uriParts.Count - 1] | |||||
| return $ArchivePath | |||||
| } | |||||
| function Copy-Archive { | |||||
| <# | |||||
| .SYNOPSIS | |||||
| This function copies the given binary file to the given target location. | |||||
| .PARAMETER ArchiveUrl | |||||
| Url where the archive should be downloaded from. | |||||
| .PARAMETER TargetDirectory | |||||
| Target directory where the archive should be downloaded. | |||||
| #> | |||||
| param ( | |||||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |||||
| [string] $ArchiveUrl, | |||||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |||||
| [string] $TargetDirectory | |||||
| ) | |||||
| $ArchiveName = Split-ArchiveFromUrl $ArchiveUrl | |||||
| $TargetPath = [IO.Path]::Combine($PSScriptRoot, "..", "packages", $ArchiveName) | |||||
| if (Test-Path $TargetPath -PathType Leaf) { | |||||
| Write-Error "$TargetPath already exists, please remove to download againg." | |||||
| return $TargetPath | |||||
| } | |||||
| if (-not (Test-Path $TargetDirectory -PathType Container)) { | |||||
| Write-Host "Creating missing $TargetDirectory" | |||||
| New-Item -Path $TargetDirectory -ItemType Directory | |||||
| } | |||||
| Write-Host "Downloading $ArchiveUrl, this might take a while..." | |||||
| $wc = New-Object System.Net.WebClient | |||||
| $wc.DownloadFile($ArchiveUrl, $TargetPath) | |||||
| return $TargetPath | |||||
| } | |||||
| $LinuxGpuArchive = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-1.14.0.tar.gz" | |||||
| $LinuxCpuArchive = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz" | |||||
| $LinuxFiles = @(".\libtensorflow.tar", ".\lib\libtensorflow.so", ".\lib\libtensorflow.so.1", ".\lib\libtensorflow.so.1.14.0", ` | |||||
| ".\lib\libtensorflow_framework.so", ".\lib\libtensorflow_framework.so.1", ".\lib\libtensorflow_framework.so.1.14.0") | |||||
| $WindowsGpuArchive = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-windows-x86_64-1.14.0.zip" | |||||
| $WindowsCpuArchive = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-1.14.0.zip" | |||||
| $WindowsFiles = @("lib\tensorflow.dll") | |||||
| $PackagesDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "packages") | |||||
| if (-not $SkipGpuLibraries) { | |||||
| $Archive = Copy-Archive -ArchiveUrl $WindowsGpuArchive -TargetDirectory $PackagesDirectory | |||||
| $TargetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "redist", "runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist") | |||||
| Expand-ZipFiles $Archive $WindowsFiles $TargetDirectory | |||||
| $Archive = Copy-Archive -ArchiveUrl $LinuxGpuArchive -TargetDirectory $PackagesDirectory | |||||
| $TargetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "redist", "runtime.linux-x64.SciSharp.Tensorflow-Gpu.Redist") | |||||
| Expand-TarGzFiles $Archive $LinuxFiles $TargetDirectory | |||||
| } | |||||
| if (-not $SkipCpuLibraries) { | |||||
| $Archive = Copy-Archive -ArchiveUrl $WindowsCpuArchive -TargetDirectory $PackagesDirectory | |||||
| $TargetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "redist", "runtime.win-x64.SciSharp.TensorFlow-Cpu.Redist") | |||||
| Expand-ZipFiles $Archive $WindowsFiles $TargetDirectory | |||||
| $Archive = Copy-Archive -ArchiveUrl $LinuxCpuArchive -TargetDirectory $PackagesDirectory | |||||
| $TargetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "redist", "runtime.linux-x64.SciSharp.Tensorflow-Cpu.Redist") | |||||
| Expand-TarGzFiles $Archive $LinuxFiles $TargetDirectory | |||||
| } | |||||
| @@ -20,15 +20,24 @@ namespace Tensorflow.Framework | |||||
| { | { | ||||
| public class smart_module | public class smart_module | ||||
| { | { | ||||
| public static Tensor[] smart_cond<T>(Tensor pred, | |||||
| Func<T[]> true_fn = null, | |||||
| Func<T[]> false_fn = null, | |||||
| public static Tensor[] smart_cond<T>(Tensor pred, | |||||
| Func<T[]> true_fn = null, | |||||
| Func<T[]> false_fn = null, | |||||
| string name = null) | string name = null) | ||||
| { | { | ||||
| return control_flow_ops.cond(pred, | |||||
| true_fn: true_fn, | |||||
| false_fn: false_fn, | |||||
| name: name); | |||||
| var pred_value = smart_constant_value(pred); | |||||
| if (pred_value.HasValue) | |||||
| { | |||||
| if (pred_value.Value) | |||||
| return true_fn() as Tensor[]; | |||||
| else | |||||
| return false_fn() as Tensor[]; | |||||
| } | |||||
| else | |||||
| return control_flow_ops.cond(pred, | |||||
| true_fn: true_fn, | |||||
| false_fn: false_fn, | |||||
| name: name); | |||||
| } | } | ||||
| public static bool? smart_constant_value(Tensor pred) | public static bool? smart_constant_value(Tensor pred) | ||||
| @@ -156,7 +156,7 @@ namespace Tensorflow.Operations | |||||
| return op.output; | return op.output; | ||||
| } | } | ||||
| public static Tensor[] _fused_batch_norm(Tensor x, | |||||
| public static Tensor[] fused_batch_norm(Tensor x, | |||||
| Tensor scale, | Tensor scale, | ||||
| Tensor offset, | Tensor offset, | ||||
| Tensor mean, | Tensor mean, | ||||
| @@ -83,6 +83,19 @@ namespace Tensorflow | |||||
| }); | }); | ||||
| } | } | ||||
| /// <summary> | |||||
| /// Batch normalization. | |||||
| /// </summary> | |||||
| /// <param name="x"></param> | |||||
| /// <param name="scale"></param> | |||||
| /// <param name="offset"></param> | |||||
| /// <param name="mean"></param> | |||||
| /// <param name="variance"></param> | |||||
| /// <param name="epsilon"></param> | |||||
| /// <param name="data_format"></param> | |||||
| /// <param name="is_training"></param> | |||||
| /// <param name="name"></param> | |||||
| /// <returns></returns> | |||||
| public static Tensor[] fused_batch_norm(Tensor x, | public static Tensor[] fused_batch_norm(Tensor x, | ||||
| RefVariable scale, | RefVariable scale, | ||||
| RefVariable offset, | RefVariable offset, | ||||
| @@ -103,7 +116,7 @@ namespace Tensorflow | |||||
| var min_epsilon = 1.001e-5f; | var min_epsilon = 1.001e-5f; | ||||
| epsilon = epsilon > min_epsilon ? epsilon : min_epsilon; | epsilon = epsilon > min_epsilon ? epsilon : min_epsilon; | ||||
| return gen_nn_ops._fused_batch_norm(x, | |||||
| var results = gen_nn_ops.fused_batch_norm(x, | |||||
| scale_tensor, | scale_tensor, | ||||
| offset_tensor, | offset_tensor, | ||||
| mean, | mean, | ||||
| @@ -112,6 +125,12 @@ namespace Tensorflow | |||||
| data_format, | data_format, | ||||
| is_training, | is_training, | ||||
| name); | name); | ||||
| var y = results[0]; | |||||
| var batch_mean = results[1]; | |||||
| var batch_var = results[2]; | |||||
| return new[] { y, batch_mean, batch_var }; | |||||
| } | } | ||||
| /// <summary> | /// <summary> | ||||
| @@ -664,7 +664,7 @@ namespace Tensorflow | |||||
| [MonoPInvokeCallback(typeof(Deallocator))] | [MonoPInvokeCallback(typeof(Deallocator))] | ||||
| internal static void FreeHGlobalMemory(IntPtr dataPtr, IntPtr len, ref DeallocatorArgs args) | internal static void FreeHGlobalMemory(IntPtr dataPtr, IntPtr len, ref DeallocatorArgs args) | ||||
| { | { | ||||
| if (args.deallocator_called) | |||||
| if (args.deallocator_called || dataPtr == IntPtr.Zero) | |||||
| return; | return; | ||||
| // NumSharp will dispose | // NumSharp will dispose | ||||
| @@ -678,7 +678,7 @@ namespace Tensorflow | |||||
| if (args.deallocator_called || args.gc_handle == IntPtr.Zero) | if (args.deallocator_called || args.gc_handle == IntPtr.Zero) | ||||
| return; | return; | ||||
| // note: since the ptr given to tensorflow is just the addr of the pinned object we can not directly free it! we need to free the gcHandle instead | // note: since the ptr given to tensorflow is just the addr of the pinned object we can not directly free it! we need to free the gcHandle instead | ||||
| //args.gchandle.Free(); | |||||
| GCHandle.FromIntPtr(args.gc_handle).Free(); | |||||
| args.deallocator_called = true; | args.deallocator_called = true; | ||||
| } | } | ||||