Skip to content

Add support for .Net 4.5. #411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -40,4 +40,12 @@ Thumbs.db
*.dotCover

.vs
*.GhostDoc.xml
*.GhostDoc.xml

# tensorflow native binaries
runtimes/
1.12.0/

# xunit console tools
xunit.runner.console-2.1.0
tools/
18 changes: 10 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
language: csharp
solution: TensorFlowSharp.sln
script:
- tsh_version=1.4.0-pre1
- tsh_version=1.12.0
- wget "https://www.nuget.org/api/v2/package/TensorFlowSharp/$tsh_version"
- tar xzvf $tsh_version native
- msbuild /t:Restore $TRAVIS_BUILD_DIR/TensorFlowSharp.sln
- tar xzvf $tsh_version runtimes
- dotnet restore $TRAVIS_BUILD_DIR/TensorFlowSharp.sln
- cd $TRAVIS_BUILD_DIR/
- msbuild /p:Configuration=Release TensorFlowSharp.sln
- cp -R $TRAVIS_BUILD_DIR/native/*.dylib $TRAVIS_BUILD_DIR/tests/TensorFlowSharp.Tests/bin/Release/
- cp -R $TRAVIS_BUILD_DIR/native/*.dylib $TRAVIS_BUILD_DIR/tests/TensorFlowSharp.Tests.CSharp/bin/Release/
- cd $TRAVIS_BUILD_DIR/packages/xunit.runner.console.2.2.0/tools
- cp "$TRAVIS_BUILD_DIR/tests/TensorFlowSharp.Tests/obj/Release/FSharp.Core.dll" .
- mono --arch=64 xunit.console.exe "$TRAVIS_BUILD_DIR/tests/TensorFlowSharp.Tests/bin/Release/TensorFlowSharp.Tests.dll" "$TRAVIS_BUILD_DIR/tests/TensorFlowSharp.Tests.CSharp/bin/Release/TensorFlowSharp.Tests.CSharp.dll"
- cp $TRAVIS_BUILD_DIR/runtimes/osx/native/*.dylib $TRAVIS_BUILD_DIR/tests/TensorFlowSharp.Tests/bin/Release/net471/
- cp -R $TRAVIS_BUILD_DIR/runtimes/osx/native/*.dylib $TRAVIS_BUILD_DIR/tests/TensorFlowSharp.Tests.CSharp/bin/Release/net471/
- wget "https://www.nuget.org/api/v2/package/xunit.runner.console/2.1.0" -O xunit.runner.console-2.1.0
- tar xzvf xunit.runner.console-2.1.0 tools
- cd $TRAVIS_BUILD_DIR/tools
- cp "$TRAVIS_BUILD_DIR/tests/TensorFlowSharp.Tests/bin/Release/net471/FSharp.Core.dll" .
- mono --arch=64 xunit.console.exe "$TRAVIS_BUILD_DIR/tests/TensorFlowSharp.Tests/bin/Release/net471/TensorFlowSharp.Tests.dll" "$TRAVIS_BUILD_DIR/tests/TensorFlowSharp.Tests.CSharp/bin/Release/net471/TensorFlowSharp.Tests.CSharp.dll"
mono: "5.10.0"
dotnet: "2.1.4"
os: "osx"
43 changes: 43 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# How to Build and Test

Unfortunately, the process is currently more manual than would be ideal. If you want to build TensorFlowSharp
from source, you first need to get the TensorFlow native binaries. CONTRIBUTING.md contains info about how to
build those from source as well or download pre-built binaries from Google. Alternatively, you can extract the
pre-built binaries from the official TensorFlowSharp nuget package. This is the easiest approach.

To do that, browse to nuget.org, find the latest TensorFlowSharp package and download the `.nupkg` file. Unzip
it (nupkg files are just zip files with a different extension) and copy the `runtimes` directory and all of its
subdirectories to `runtimes` at the root of this repo.

## Building

Once the native libraries have been copied to the `runtimes` directory, you should be able to build the project with
`dotnet build`. This will build for .net4.5, .net4.6 and newer and netstandard2.0. If you specify, `-c Release` as an
option on the build commandline, it will also produce a copy of the nupkg file with all three binary types packed inside
(as well as the native libraries for windows, osx and linux).

## Testing

In order to test on net45 or net471, you will need to download `xunit.console.exe`. Once again, you can browse to
nuget.org and find the `2.1.0` version of the package `xunit.runners.console`. You must use this old version of xunit
beacuse newer versions do not support net45. Download the nupkg file, unzip it, and copy the `tools` directory to
`tools` at the root of this repo.

### Testing for Net45

From the root of the repo run `tools\xunit.console.exe tests\TensorFlowSharp.Tests\bin\debug\net45\TensorFlowSharp.Tests.dll tests\TensorFlowSharp.Tests.CSharp\bin\debug\net45\TensorFlowSharp.Tests.CSharp.dll`

On windows 6 tests fail. Results may be slightly different on other platforms.

### Testing for Net471

From the root of the repo run `tools\xunit.console.exe tests\TensorFlowSharp.Tests\bin\debug\net471\TensorFlowSharp.Tests.dll tests\TensorFlowSharp.Tests.CSharp\bin\debug\net471\TensorFlowSharp.Tests.CSharp.dll`

On windows 6 tests fail. Results may be slightly different on other platforms.

### Testing for NetStandard2.0

From the root of the repo run `dotnet test`.

On Windows 1 test fails in the f# test project, and 6 tests fail in the c# test project. Results may be slightly
different on other platforms.
57 changes: 6 additions & 51 deletions Examples/ExampleCommon/ExampleCommon.csproj
Original file line number Diff line number Diff line change
@@ -1,56 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{116BA176-F67C-4066-8685-C080705BAA16}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ExampleCommon</RootNamespace>
<AssemblyName>ExampleCommon</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<ReleaseVersion>0.2</ReleaseVersion>
<TargetFrameworks>net45;net471;netstandard2.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CatalogUtil.cs" />
<Compile Include="ImageUtil.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj">
<Project>{0264c321-34f4-46af-819e-168d1e597232}</Project>
<Name>TensorFlowSharp</Name>
</ProjectReference>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

</Project>
36 changes: 0 additions & 36 deletions Examples/ExampleCommon/Properties/AssemblyInfo.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,59 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{069A6736-7711-4805-8660-A267E713BC54}</ProjectGuid>
<TargetFrameworks>net45;net471;netcoreapp2.2</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>ExampleInceptionInference</RootNamespace>
<AssemblyName>ExampleInceptionInference</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<ReleaseVersion>0.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Mono.Options">
<HintPath>..\..\packages\Mono.Options.4.4.0.0\lib\net4-client\Mono.Options.dll</HintPath>
</Reference>
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Numerics" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj">
<Project>{0264C321-34F4-46AF-819E-168D1E597232}</Project>
<Name>TensorFlowSharp</Name>
</ProjectReference>
<ProjectReference Include="..\ExampleCommon\ExampleCommon.csproj">
<Project>{116BA176-F67C-4066-8685-C080705BAA16}</Project>
<Name>ExampleCommon</Name>
</ProjectReference>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj" />
<ProjectReference Include="..\ExampleCommon\ExampleCommon.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="Mono.Options" Version="4.4.0" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

</Project>
26 changes: 0 additions & 26 deletions Examples/ExampleInceptionInference/Properties/AssemblyInfo.cs

This file was deleted.

4 changes: 0 additions & 4 deletions Examples/ExampleInceptionInference/packages.config

This file was deleted.

3 changes: 0 additions & 3 deletions Examples/ExampleObjectDetection/App.config
Original file line number Diff line number Diff line change
@@ -4,7 +4,4 @@
<add key="DefaultModelUrl" value="http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_resnet_v2_atrous_coco_11_06_2017.tar.gz"/>
<add key="DefaultTextsUrl" value="https://raw.githubusercontent.com/tensorflow/models/master/research/object_detection/data/mscoco_label_map.pbtxt"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
</configuration>
85 changes: 15 additions & 70 deletions Examples/ExampleObjectDetection/ExampleObjectDetection.csproj
Original file line number Diff line number Diff line change
@@ -1,84 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{69471B59-576D-446B-8DF3-96EC783C0B6C}</ProjectGuid>
<TargetFrameworks>net45;net471</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>ExampleObjectDetection</RootNamespace>
<AssemblyName>ExampleObjectDetection</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
<ReleaseVersion>0.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

<ItemGroup>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="Mono.Options, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Mono.Options.5.3.0.1\lib\net4-client\Mono.Options.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.ValueTuple.4.4.0\lib\net471\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ImageEditor.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<Content Include="test_images\input.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj">
<Project>{0264C321-34F4-46AF-819E-168D1E597232}</Project>
<Name>TensorFlowSharp</Name>
</ProjectReference>
<ProjectReference Include="..\ExampleCommon\ExampleCommon.csproj">
<Project>{116BA176-F67C-4066-8685-C080705BAA16}</Project>
<Name>ExampleCommon</Name>
</ProjectReference>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj" />
<ProjectReference Include="..\ExampleCommon\ExampleCommon.csproj" />
</ItemGroup>

<ItemGroup>
<Content Include="test_images\input.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<PackageReference Include="Mono.Options" Version="5.3.0.1" />
<PackageReference Include="SharpZipLib" Version="1.1.0" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

</Project>
36 changes: 0 additions & 36 deletions Examples/ExampleObjectDetection/Properties/AssemblyInfo.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Examples/ExampleObjectDetection/packages.config

This file was deleted.

20 changes: 0 additions & 20 deletions Examples/FExampleInceptionInference/AssemblyInfo.fs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,70 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{03FB7F3A-6D24-4033-9B04-69AD8A198CCF}</ProjectGuid>
<TargetFrameworks>net45;net471;netcoreapp2.2</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>FExampleInceptionInference</RootNamespace>
<AssemblyName>FExampleInceptionInference</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<ReleaseVersion>0.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<ExternalConsole>true</ExternalConsole>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<ExternalConsole>true</ExternalConsole>
<GenerateTailCalls>true</GenerateTailCalls>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0' OR '$(VisualStudioVersion)' == '11.0'">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>

<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Compile Include="Program.fs" />
</ItemGroup>

<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Program.fs" />
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj">
<Project>{0264C321-34F4-46AF-819E-168D1E597232}</Project>
<Name>TensorFlowSharp</Name>
</ProjectReference>
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
</ItemGroup>
<Import Project="$(FSharpTargetsPath)" />
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Policies>
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-fsharp" />
<FSharpFormattingPolicy scope="text/x-fsharp">
<DefaultFormat IndentOnTryWith="False" ReorderOpenDeclaration="False" SpaceAfterComma="True" SpaceAfterSemicolon="True" SpaceAroundDelimiter="True" SpaceBeforeArgument="True" SpaceBeforeColon="True" __added="0" />
</FSharpFormattingPolicy>
</Policies>
</Properties>
</MonoDevelop>
</ProjectExtensions>

</Project>
3 changes: 3 additions & 0 deletions Examples/ImageCompression/ImageCompression.fs
Original file line number Diff line number Diff line change
@@ -3,6 +3,9 @@
//
// From models/compression/encoder.py
//

module ImageCompression

open System
open System.IO
open TensorFlow
59 changes: 9 additions & 50 deletions Examples/ImageCompression/ImageCompression.fsproj
Original file line number Diff line number Diff line change
@@ -1,58 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5A493E1F-407D-4A3B-AF9B-A0F2930C1C18}</ProjectGuid>
<TargetFrameworks>net45;net471;netcoreapp2.2</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>ImageCompression</RootNamespace>
<AssemblyName>ImageCompression</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<ReleaseVersion>0.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<ExternalConsole>true</ExternalConsole>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<ExternalConsole>true</ExternalConsole>
<GenerateTailCalls>true</GenerateTailCalls>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0' OR '$(VisualStudioVersion)' == '11.0'">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>

<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj">
<Project>{0264C321-34F4-46AF-819E-168D1E597232}</Project>
<Name>TensorFlowSharp</Name>
</ProjectReference>
<Compile Include="ImageCompression.fs" />
<Content Include="example.png" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
<Compile Include="ImageCompression.fs" />
<Content Include="example.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj" />
</ItemGroup>
<Import Project="$(FSharpTargetsPath)" />

</Project>
59 changes: 6 additions & 53 deletions Learn/Learn.csproj
Original file line number Diff line number Diff line change
@@ -1,59 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{20567EDE-7C20-4734-B489-C6D303843105}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Learn</RootNamespace>
<AssemblyName>Learn</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<ReleaseVersion>0.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TargetFrameworks>net45;net471;netstandard2.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Datasets\MNIST.cs" />
<Compile Include="Datasets\Helper.cs" />
<Compile Include="DataConverter.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Datasets\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TensorFlowSharp\TensorFlowSharp.csproj">
<Project>{0264C321-34F4-46AF-819E-168D1E597232}</Project>
<Name>TensorFlowSharp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<ProjectReference Include="..\TensorFlowSharp\TensorFlowSharp.csproj" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

</Project>
26 changes: 0 additions & 26 deletions Learn/Properties/AssemblyInfo.cs

This file was deleted.

4 changes: 0 additions & 4 deletions Learn/packages.config

This file was deleted.

2 changes: 1 addition & 1 deletion OpGenerator/OpGenerator.cs
Original file line number Diff line number Diff line change
@@ -565,7 +565,7 @@ void UpdateApis (string [] dirs)

void Run (string [] dirs)
{
output = File.CreateText ("../../../TensorFlowSharp/Operations.g.cs");
output = File.CreateText ("../../../../../TensorFlowSharp/Operations.g.cs");
var operations = Serializer.Deserialize<List<OpDef>> (GetOpsList ());
UpdateApis (dirs);
p ("using System;\n");
72 changes: 26 additions & 46 deletions OpGenerator/OpGenerator.csproj
Original file line number Diff line number Diff line change
@@ -1,57 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{700E5928-3D5D-4B54-AD4D-BC48E79E389E}</ProjectGuid>
<TargetFrameworks>net45;net471;netcoreapp2.2</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>OpGenerator</RootNamespace>
<AssemblyName>OpGenerator</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<ReleaseVersion>0.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x64</PlatformTarget>
<Platform>x64</Platform>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="protobuf-net">
<HintPath>..\packages\protobuf-net.2.3.2\lib\net40\protobuf-net.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="OpGenerator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Opdefs.cs" />
<Compile Include="api_def.cs" />
<Folder Include="New Folder\" />
</ItemGroup>

<ItemGroup>
<Folder Include="New Folder\" />
<Content Condition="'$(IsOSX)' != 'true' and '$(IsLinux)' != 'true'"
Include="..\runtimes\win7-x64\native\libtensorflow.dll"
CopyToOutputDirectory="PreserveNewest" pack="false" />
<Content Condition="'$(IsOSX)' == 'true'"
Include="..\runtimes\osx\native\libtensorflow.dylib"
CopyToOutputDirectory="PreserveNewest" pack="false" />
<Content Condition="'$(IsOSX)' == 'true'"
Include="..\runtimes\osx\native\libtensorflow_framework.dylib"
CopyToOutputDirectory="PreserveNewest" pack="false" />
<Content Condition="'$(IsLinux)' == 'true'"
Include="..\runtimes\linux\native\libtensorflow.so"
CopyToOutputDirectory="PreserveNewest" pack="false" />
<Content Condition="'$(IsLinux)' == 'true'"
Include="..\runtimes\linux\native\libtensorflow_framework.so"
CopyToOutputDirectory="PreserveNewest" pack="false" />
</ItemGroup>

<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="Google.Protobuf" Version="3.4.1" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.4.0" />
<PackageReference Include="protobuf-net" Version="2.3.2" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
26 changes: 0 additions & 26 deletions OpGenerator/Properties/AssemblyInfo.cs

This file was deleted.

6 changes: 0 additions & 6 deletions OpGenerator/packages.config

This file was deleted.

26 changes: 0 additions & 26 deletions SampleTest/Properties/AssemblyInfo.cs

This file was deleted.

66 changes: 9 additions & 57 deletions SampleTest/SampleTest.csproj
Original file line number Diff line number Diff line change
@@ -1,66 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{243E2C90-F465-4A6E-9063-8F2C138015C7}</ProjectGuid>
<TargetFrameworks>net45;net471;netcoreapp2.2</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>SampleTest</RootNamespace>
<AssemblyName>SampleTest</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<ReleaseVersion>0.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
<PlatformTarget>x64</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
<PlatformTarget>x64</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="CsvHelper">
<HintPath>..\packages\CsvHelper.2.16.3.0\lib\net45\CsvHelper.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="SampleTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="LowLevelTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TensorFlowSharp\TensorFlowSharp.csproj">
<Project>{0264C321-34F4-46AF-819E-168D1E597232}</Project>
<Name>TensorFlowSharp</Name>
</ProjectReference>
<ProjectReference Include="..\Learn\Learn.csproj">
<Project>{20567EDE-7C20-4734-B489-C6D303843105}</Project>
<Name>Learn</Name>
</ProjectReference>
<ProjectReference Include="..\TensorFlowSharp\TensorFlowSharp.csproj" />
<ProjectReference Include="..\Learn\Learn.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="CsvHelper" Version="2.16.3.0" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

</Project>
5 changes: 0 additions & 5 deletions SampleTest/packages.config

This file was deleted.

4 changes: 4 additions & 0 deletions TensorFlowSharp/Buffer.cs
Original file line number Diff line number Diff line change
@@ -133,7 +133,11 @@ internal static void FreeBlock (IntPtr data, IntPtr length)
static TFBuffer ()
{
FreeBlockDelegate = FreeBlock;
#if NET45
FreeBufferFunc = Marshal.GetFunctionPointerForDelegate (FreeBlockDelegate);
#else
FreeBufferFunc = Marshal.GetFunctionPointerForDelegate<BufferReleaseFunc> (FreeBlockDelegate);
#endif
}


209 changes: 209 additions & 0 deletions TensorFlowSharp/BufferInternal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
// This file is copied from:
// github.com/dotnet/corefx repo - commit id: 0bb106232745aedfc0d0c5a84ff2b244bf190317
// file: corefx/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/BufferInternal.cs
//
// It's needed to enable running on Net 4.5 where System.Buffer.Memmove is unavailable.
// The only changes from the original are this comment header and wrapping everything else with #if NET45/#endif.

#if NET45
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Diagnostics;
using System.Runtime.CompilerServices;

namespace System {

// These sources are taken from corclr repo (src\mscorlib\src\System\Buffer.cs with x64 path removed)
// The reason for this duplication is that System.Runtime.dll 4.0.10 did not expose Buffer.MemoryCopy,
// but we need to make this component work with System.Runtime.dll 4.0.10
// The methods AreOverlapping and SlowCopyBackwards are not from Buffer.cs. Buffer.cs does an internal CLR call for these.
static class BufferInternal
{
// This method has different signature for x64 and other platforms and is done for performance reasons.
private static unsafe void Memmove(byte* dest, byte* src, uint len)
{
if (AreOverlapping(dest, src, len))
{
SlowCopyBackwards(dest, src, len);
return;
}

// This is portable version of memcpy. It mirrors what the hand optimized assembly versions of memcpy typically do.
switch (len)
{
case 0:
return;
case 1:
*dest = *src;
return;
case 2:
*(short*)dest = *(short*)src;
return;
case 3:
*(short*)dest = *(short*)src;
*(dest + 2) = *(src + 2);
return;
case 4:
*(int*)dest = *(int*)src;
return;
case 5:
*(int*)dest = *(int*)src;
*(dest + 4) = *(src + 4);
return;
case 6:
*(int*)dest = *(int*)src;
*(short*)(dest + 4) = *(short*)(src + 4);
return;
case 7:
*(int*)dest = *(int*)src;
*(short*)(dest + 4) = *(short*)(src + 4);
*(dest + 6) = *(src + 6);
return;
case 8:
*(int*)dest = *(int*)src;
*(int*)(dest + 4) = *(int*)(src + 4);
return;
case 9:
*(int*)dest = *(int*)src;
*(int*)(dest + 4) = *(int*)(src + 4);
*(dest + 8) = *(src + 8);
return;
case 10:
*(int*)dest = *(int*)src;
*(int*)(dest + 4) = *(int*)(src + 4);
*(short*)(dest + 8) = *(short*)(src + 8);
return;
case 11:
*(int*)dest = *(int*)src;
*(int*)(dest + 4) = *(int*)(src + 4);
*(short*)(dest + 8) = *(short*)(src + 8);
*(dest + 10) = *(src + 10);
return;
case 12:
*(int*)dest = *(int*)src;
*(int*)(dest + 4) = *(int*)(src + 4);
*(int*)(dest + 8) = *(int*)(src + 8);
return;
case 13:
*(int*)dest = *(int*)src;
*(int*)(dest + 4) = *(int*)(src + 4);
*(int*)(dest + 8) = *(int*)(src + 8);
*(dest + 12) = *(src + 12);
return;
case 14:
*(int*)dest = *(int*)src;
*(int*)(dest + 4) = *(int*)(src + 4);
*(int*)(dest + 8) = *(int*)(src + 8);
*(short*)(dest + 12) = *(short*)(src + 12);
return;
case 15:
*(int*)dest = *(int*)src;
*(int*)(dest + 4) = *(int*)(src + 4);
*(int*)(dest + 8) = *(int*)(src + 8);
*(short*)(dest + 12) = *(short*)(src + 12);
*(dest + 14) = *(src + 14);
return;
case 16:
*(int*)dest = *(int*)src;
*(int*)(dest + 4) = *(int*)(src + 4);
*(int*)(dest + 8) = *(int*)(src + 8);
*(int*)(dest + 12) = *(int*)(src + 12);
return;
default:
break;
}

if ((unchecked((int)dest) & 3) != 0)
{
if (((int)dest & 1) != 0)
{
*dest = *src;
src++;
dest++;
len--;
if (((int)dest & 2) == 0)
goto Aligned;
}
*(short*)dest = *(short*)src;
src += 2;
dest += 2;
len -= 2;
Aligned:;
}

uint count = len / 16;
while (count > 0)
{
((int*)dest)[0] = ((int*)src)[0];
((int*)dest)[1] = ((int*)src)[1];
((int*)dest)[2] = ((int*)src)[2];
((int*)dest)[3] = ((int*)src)[3];
dest += 16;
src += 16;
count--;
}

if ((len & 8) != 0)
{
((int*)dest)[0] = ((int*)src)[0];
((int*)dest)[1] = ((int*)src)[1];
dest += 8;
src += 8;
}
if ((len & 4) != 0)
{
((int*)dest)[0] = ((int*)src)[0];
dest += 4;
src += 4;
}
if ((len & 2) != 0)
{
((short*)dest)[0] = ((short*)src)[0];
dest += 2;
src += 2;
}
if ((len & 1) != 0)
*dest = *src;

return;
}

private static unsafe void SlowCopyBackwards(byte* dest, byte* src, uint len)
{
Debug.Assert(len <= int.MaxValue);
if (len == 0) return;

for(int i=((int)len)-1; i>=0; i--)
{
dest[i] = src[i];
}
}

private static unsafe bool AreOverlapping(byte* dest, byte* src, uint len)
{
byte* srcEnd = src + len;
byte* destEnd = dest + len;
if (srcEnd >= dest && srcEnd <= destEnd)
{
return true;
}
return false;
}

// The attributes on this method are chosen for best JIT performance.
// Please do not edit unless intentional.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void MemoryCopy(void* source, void* destination, int destinationSizeInBytes, int sourceBytesToCopy)
{
if (sourceBytesToCopy > destinationSizeInBytes)
{
throw new ArgumentOutOfRangeException(nameof(sourceBytesToCopy));
}

Memmove((byte*)destination, (byte*)source, checked((uint)sourceBytesToCopy));
}
}
}
#endif
6 changes: 3 additions & 3 deletions TensorFlowSharp/Queue.cs
Original file line number Diff line number Diff line change
@@ -189,7 +189,7 @@ public override TFOperation Enqueue (TFOutput [] components, long? timeout_ms =
public TFTensor [] EnqueueExecute (TFOutput [] components, TFTensor [] inputValues, long? timeout_ms = null, string operationName = null)
{
TFOperation enqueueOp = Enqueue (components, timeout_ms, operationName);
TFTensor [] tensors = Session.Run (components, inputValues, Array.Empty<TFOutput> (), new [] { enqueueOp });
TFTensor [] tensors = Session.Run (components, inputValues, new TFOutput[0], new [] { enqueueOp });
return tensors;
}

@@ -244,7 +244,7 @@ public override TFOutput [] Dequeue (long? timeout_ms = null, string operationNa
public TFTensor [] DequeueExecute (long? timeout_ms = null, string operationName = null)
{
TFOutput [] values = Session.Graph.QueueDequeueV2 (_handle, _componentTypes, timeout_ms, operationName);
TFTensor [] tensors = Session.Run (Array.Empty<TFOutput> (), Array.Empty<TFTensor> (), values);
TFTensor [] tensors = Session.Run (new TFOutput[0], new TFTensor[0], values);
return tensors;
}

@@ -287,7 +287,7 @@ public override TFOutput GetSize (string operationName = null)
public int GetSizeExecute (string operationName = null)
{
TFOutput sizeOutput = GetSize (operationName);
TFTensor [] tensors = Session.Run (Array.Empty<TFOutput> (), Array.Empty<TFTensor> (), new TFOutput [] { sizeOutput });
TFTensor [] tensors = Session.Run (new TFOutput[0], new TFTensor[0], new TFOutput [] { sizeOutput });
return (int)tensors.First ().GetValue ();
}
}
4 changes: 4 additions & 0 deletions TensorFlowSharp/Tensor.cs
Original file line number Diff line number Diff line change
@@ -1145,7 +1145,11 @@ internal static unsafe void Set (Array target, TFDataType dt, long [] shape, int

unsafe static void Copy (IntPtr src, void* target, int size)
{
#if NET45
BufferInternal.MemoryCopy((void*)src, (void*)target, size, size);
#else
Buffer.MemoryCopy ((void*)src, target, size, size);
#endif
}

static unsafe void FetchFlatArray (Array target, TFDataType dt, IntPtr data)
38 changes: 30 additions & 8 deletions TensorFlowSharp/TensorFlowSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net471;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net45;net46;netstandard2.0</TargetFrameworks>
<RootNamespace>TensorFlowSharp</RootNamespace>
<AssemblyName>TensorFlowSharp</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<DocumentationFile>bin\Debug\TensorFlowSharp.xml</DocumentationFile>
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
<ReleaseVersion>0.2</ReleaseVersion>
<TensorFlowRuntimeVersion>1.12.0</TensorFlowRuntimeVersion>
</PropertyGroup>

<PropertyGroup>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<PackageId>TensorFlowSharp</PackageId>
<PackageVersion>1.10.0-pre1</PackageVersion>
<PackageVersion>1.12.0</PackageVersion>
<Authors>Miguel de Icaza</Authors>
<PackageLicenseUrl>https://github.com/migueldeicaza/TensorFlowSharp/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/migueldeicaza/TensorFlowSharp/</PackageProjectUrl>
@@ -26,14 +25,37 @@
<PackageReleaseNotes>1.12.0 adds support for the TensorFlow 1.12 release</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup>
<IsOSX Condition="Exists('/Library/Frameworks') and Exists ('/etc')">true</IsOSX>
<IsLinux Condition="Exists ('/proc') and Exists ('/etc/')">true</IsLinux>
</PropertyGroup>

<ItemGroup>
<Content Condition="'$(IsOSX)' != 'true' and '$(IsLinux)' != 'true'"
Include="..\runtimes\win7-x64\native\libtensorflow.dll"
CopyToOutputDirectory="PreserveNewest" pack="false" />
<Content Condition="'$(IsOSX)' == 'true'"
Include="..\runtimes\osx\native\libtensorflow.dylib"
CopyToOutputDirectory="PreserveNewest" pack="false" />
<Content Condition="'$(IsOSX)' == 'true'"
Include="..\runtimes\osx\native\libtensorflow_framework.dylib"
CopyToOutputDirectory="PreserveNewest" pack="false" />
<Content Condition="'$(IsLinux)' == 'true'"
Include="..\runtimes\linux\native\libtensorflow.so"
CopyToOutputDirectory="PreserveNewest" pack="false" />
<Content Condition="'$(IsLinux)' == 'true'"
Include="..\runtimes\linux\native\libtensorflow_framework.so"
CopyToOutputDirectory="PreserveNewest" pack="false" />
</ItemGroup>

<ItemGroup>
<None Remove="nuget\build\net45\TensorFlowSharp.targets" />
<None Include="nuget\build\net45\TensorFlowSharp.targets" PackagePath="build\net45\TensorFlowSharp.targets" Pack="true" />
<None Include="..\native\libtensorflow.dll" Link="nuget\runtimes\win7-x64\native\libtensorflow.dll" PackagePath="runtimes\win7-x64\native\libtensorflow.dll" Pack="true" />
<None Include="..\native\libtensorflow.dylib" Link="nuget\runtimes\osx\native\libtensorflow.dylib" PackagePath="runtimes\osx\native\libtensorflow.dylib" Pack="true" />
<None Include="..\native\libtensorflow_framework.dylib" Link="nuget\runtimes\osx\native\libtensorflow_framework.dylib" PackagePath="runtimes\osx\native\libtensorflow_framework.dylib" Pack="true" />
<None Include="..\native\libtensorflow.so" Link="nuget\runtimes\linux\native\libtensorflow.so" PackagePath="runtimes\linux\native\libtensorflow.so" Pack="true" />
<None Include="..\native\libtensorflow_framework.so" Link="nuget\runtimes\linux\native\libtensorflow_framework.so" PackagePath="runtimes\linux\native\libtensorflow_framework.so" Pack="true" />
<None Include="..\runtimes\win7-x64\native\libtensorflow.dll" Link="nuget\runtimes\win7-x64\native\libtensorflow.dll" PackagePath="runtimes\win7-x64\native\libtensorflow.dll" Pack="true" />
<None Include="..\runtimes\osx\native\libtensorflow.dylib" Link="nuget\runtimes\osx\native\libtensorflow.dylib" PackagePath="runtimes\osx\native\libtensorflow.dylib" Pack="true" />
<None Include="..\runtimes\osx\native\libtensorflow_framework.dylib" Link="nuget\runtimes\osx\native\libtensorflow_framework.dylib" PackagePath="runtimes\osx\native\libtensorflow_framework.dylib" Pack="true" />
<None Include="..\runtimes\linux\native\libtensorflow.so" Link="nuget\runtimes\linux\native\libtensorflow.so" PackagePath="runtimes\linux\native\libtensorflow.so" Pack="true" />
<None Include="..\runtimes\linux\native\libtensorflow_framework.so" Link="nuget\runtimes\linux\native\libtensorflow_framework.so" PackagePath="runtimes\linux\native\libtensorflow_framework.so" Pack="true" />
</ItemGroup>

<ItemGroup>
6 changes: 3 additions & 3 deletions tests/TensorFlowSharp.Tests.CSharp/ArrayTests.cs
Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ public void BasicConstantsUnSymmetrical ()
}
#endif

private static IEnumerable<object[]> stackData()
public static IEnumerable<object[]> stackData()
{
// Example from https://www.tensorflow.org/api_docs/python/tf/stack

@@ -198,7 +198,7 @@ public void Should_Stack(double[] x, double[] y, double[] z, int? axis, double[,
}
}

private static IEnumerable<object[]> rangeData()
public static IEnumerable<object[]> rangeData()
{
double[] x = { 1, 4 };
double[] y = { 2, 5 };
@@ -257,7 +257,7 @@ public void Should_Range(object start, object limit, object delta, object expect
}


private static IEnumerable<object []> transposeData ()
public static IEnumerable<object []> transposeData ()
{
yield return new object [] { new double [,] { { 1, 2 },
{ 3, 4 } }};
6 changes: 3 additions & 3 deletions tests/TensorFlowSharp.Tests.CSharp/ClipTests.cs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ namespace TensorFlowSharp.Tests.CSharp
{
public class ClipTests
{
private static IEnumerable<object[]> clipByValueData()
public static IEnumerable<object[]> clipByValueData()
{
yield return new object[]
{
@@ -68,7 +68,7 @@ public void Should_ClipByValue(double[,] m, double min, double max, double[,] ex



private static IEnumerable<object[]> clipByNormData()
public static IEnumerable<object[]> clipByNormData()
{
yield return new object[]
{
@@ -171,7 +171,7 @@ public void Should_ClipByNorm(double[,] m, double norm, int axis, double[,] expe



private static IEnumerable<object[]> clipByAverageNormData()
public static IEnumerable<object[]> clipByAverageNormData()
{
yield return new object[]
{
8 changes: 4 additions & 4 deletions tests/TensorFlowSharp.Tests.CSharp/MathTests.cs
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ public void Should_CalculateTanhGrad_Correctly ()
}
}

private static IEnumerable<object []> reduceMeanData ()
public static IEnumerable<object []> reduceMeanData ()
{
// Example from https://www.tensorflow.org/api_docs/python/tf/reduce_mean
// # 'x' is [[1., 1.]
@@ -72,7 +72,7 @@ public void Should_ReduceMean (double [,] input, int? axis, object expected)
}
}

private static IEnumerable<object []> sigmoidCrossEntropyData ()
public static IEnumerable<object []> sigmoidCrossEntropyData ()
{
yield return new object [] { new [] { 1.0, 0.0, 1.0, 1.0 }, new [] { 1.0, 0.0, 1.0, 1.0 }, new [] { 0.31326168751822281, 0.69314718055994529, 0.31326168751822281, 0.31326168751822281 } };
yield return new object [] { new [] { 1.0, 0.0, 1.0, 1.0 }, new [] { -0.2, 4.2, 0.0, 0.0 }, new [] { 0.79813886938159184, 4.2148842546719187, 0.69314718055994529, 0.69314718055994529 } };
@@ -101,7 +101,7 @@ public void Should_SigmoidCrossEntropyWithLogits (double [] labels, double [] lo
}
}

private static IEnumerable<object []> reduceProdData ()
public static IEnumerable<object []> reduceProdData ()
{
// Example from https://www.tensorflow.org/api_docs/python/tf/reduce_mean but adapted to return prod
var x = new double [,] { { 1, 1 },
@@ -138,7 +138,7 @@ public void Should_ReduceProd (double [,] input, int? axis, object expected)
}
}

private static IEnumerable<object []> reduceProdData2 ()
public static IEnumerable<object []> reduceProdData2 ()
{
yield return new object [] { null, 170170.0 };
yield return new object [] { -3, new [] { 1.0 } };
36 changes: 0 additions & 36 deletions tests/TensorFlowSharp.Tests.CSharp/Properties/AssemblyInfo.cs

This file was deleted.

127 changes: 21 additions & 106 deletions tests/TensorFlowSharp.Tests.CSharp/TensorFlowSharp.Tests.CSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,91 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\xunit.runner.visualstudio.2.3.0-beta3-build3705\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\packages\xunit.runner.visualstudio.2.3.0-beta3-build3705\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6504A704-575C-48D0-A4D2-422A7010936B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TensorFlowSharp.Tests.CSharp</RootNamespace>
<AssemblyName>TensorFlowSharp.Tests.CSharp</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<ReleaseVersion>0.2</ReleaseVersion>
<TargetFrameworks>net45;net471;netcoreapp2.2</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>
</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AssemblyName>
</AssemblyName>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.DotNet.InternalAbstractions, Version=1.0.500.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.DotNet.InternalAbstractions.1.0.500-preview2-1-003177\lib\net451\Microsoft.DotNet.InternalAbstractions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
</Reference>
<Reference Include="xunit.assert, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="xunit.core, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll</HintPath>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<Compile Include="CondTests.cs" />
<Compile Include="GradientTests.cs" />
<Compile Include="ArrayTests.cs" />
<Compile Include="OptimizerTests.cs" />
<Compile Include="SessionTests.cs" />
<Compile Include="ShapeTests.cs" />
<Compile Include="TensorTests.cs" />
<Compile Include="ClipTests.cs" />
<Compile Include="BitwiseOperationTests.cs" />
<Compile Include="MathTests.cs" />
<Compile Include="PaddingFIFOQueueTests.cs" />
<Compile Include="PartialRunTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestUtils.cs" />
<Compile Include="VariableTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="TestData\MomentumNesterovTimeDecay\optimizer_lr_test.py">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -108,20 +27,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Learn\Learn.csproj">
<Project>{20567ede-7c20-4734-b489-c6d303843105}</Project>
<Name>Learn</Name>
</ProjectReference>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj">
<Project>{0264c321-34f4-46af-819e-168d1e597232}</Project>
<Name>TensorFlowSharp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />

<ItemGroup>
<Content Include="TestData\MomentumNesterovTimeDecay\expected.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -145,11 +51,20 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\xunit.runner.visualstudio.2.3.0-beta3-build3705\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.runner.visualstudio.2.3.0-beta3-build3705\build\net20\xunit.runner.visualstudio.props'))" />
</Target>

<ItemGroup>
<ProjectReference Include="..\..\Learn\Learn.csproj" />
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp2.2'">
<PackageReference Include="xunit" Version="2.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion tests/TensorFlowSharp.Tests.CSharp/TensorTests.cs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ namespace TensorFlowSharp.Tests.CSharp
{
public class TensorTests
{
private static IEnumerable<object []> jaggedData ()
public static IEnumerable<object []> jaggedData ()
{
yield return new object [] {
new double [][] { new [] { 1.0, 2.0 }, new [] { 3.0, 4.0 } },
14 changes: 0 additions & 14 deletions tests/TensorFlowSharp.Tests.CSharp/packages.config

This file was deleted.

41 changes: 0 additions & 41 deletions tests/TensorFlowSharp.Tests/AssemblyInfo.fs

This file was deleted.

111 changes: 16 additions & 95 deletions tests/TensorFlowSharp.Tests/TensorFlowSharp.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,104 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>9ee13143-569f-4f7a-975a-de7df5c8ff0b</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>TensorFlowSharp.Tests</RootNamespace>
<AssemblyName>TensorFlowSharp.Tests</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Name>TensorFlowSharp.Tests</Name>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworks>net45;net471;netcoreapp2.2</TargetFrameworks>
<ReleaseVersion>0.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Debug\TensorFlowSharp.Tests.XML</DocumentationFile>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Release\TensorFlowSharp.Tests.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />

<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="ArithmeticOperationTests.fs" />
<Content Include="packages.config" />
</ItemGroup>

<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj">
<Name>TensorFlowSharp</Name>
<Project>{0264c321-34f4-46af-819e-168d1e597232}</Project>
<Private>True</Private>
</ProjectReference>
<Reference Include="xunit.abstractions">
<HintPath>..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert">
<HintPath>..\..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.console">
<HintPath>..\..\packages\xunit.runner.console.2.2.0\tools\xunit.console.exe</HintPath>
</Reference>
<Reference Include="xunit.core">
<HintPath>..\..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.execution.desktop">
<HintPath>..\..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.runner.reporters.net452">
<HintPath>..\..\packages\xunit.runner.console.2.2.0\tools\xunit.runner.reporters.net452.dll</HintPath>
</Reference>
<ProjectReference Include="..\..\TensorFlowSharp\TensorFlowSharp.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp2.2'">
<PackageReference Include="xunit" Version="2.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2'">
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->

</Project>
10 changes: 0 additions & 10 deletions tests/TensorFlowSharp.Tests/packages.config

This file was deleted.