Install-Package tf.NET -Version
dotnet add package tf.NET --version
<PackageReference Include="tf.NET" Version="" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add tf.NET --version
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: tf.NET,"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install tf.NET as a Cake Addin
#addin nuget:?package=tf.NET&version=

// Install tf.NET as a Cake Tool
#tool nuget:?package=tf.NET&version=
The NuGet Team does not provide support for this client. Please contact its maintainers for support.



.NET bindings for the TensorFlow 2 C API. These are low-level bindings suitable for creating higher-level idiomatic interfaces to TensorFlow 2 in .NET languages like C# and F#.


  • C# bindings autogenerated from the TensorFlow C header files using CppSharp.
  • C# op definitions autogenerated from the TensorFlow 2 runtime op definitions. The generator is based on the one created by Miguel de Icaza for TensorFlowSharp.
  • Tensor object implementation that uses zero-copy reinterpretation of existing .NET multi-dimensional arrays as tensor data.


The main differences between this and TensorFlow.NET and TensorSharp and other .NET TensorFlow projects are:

  • tf.NET supports TensorFlow 2 only. TensorFlow.NET and other libraries currently only support TF 1.
  • tf.NET does not try to implement any higher-level APIs for ML or things like that. I made this because I wanted a low-level direct binding to the TensorFlow 2 API that I could use to create my own .NET scientific computing language in F#. Looking at the code for TensorFlow.NET, it seems to me that it mixes a lot of higher-level C# code and the bindings together. tf.NET has implementations of essential memory-backed objects like buffers and tensors but usage of these implementations is purely optional.


Available from NuGet

PM> Install-Package tf.NET

Note that you will still need the TensorFlow 2 native runtime library (i.e. libtensorflow) for your OS. There doesn't seem to be an official Google libtensorflow package for version 2 as yet. For Windows you can build it yourself or check out this package which installs a CPU-only TF 2 native library dependency into your .NET project. For Linux you can download nightly builds of libtensorflow from the TensorFlow Github page.

For usage examples see the unit tests.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated 495 1/7/2020
0.2.3 313 1/7/2020
0.2.2 397 1/4/2020
0.2.0-r2.0 209 12/30/2019

Add export functions.