Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions pkg/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<IncludeSymbols>false</IncludeSymbols>
<IsSymbolsPackage Condition="$(MSBuildProjectName.Contains('.symbols'))">true</IsSymbolsPackage>
<PackageIdFolderName>$(MSBuildProjectName.Replace('.symbols', ''))</PackageIdFolderName>
<PackageReadmeFile Condition="'$(IsSymbolsPackage)' != 'true' AND Exists('$(MSBuildProjectDirectory)\README.md')">README.md</PackageReadmeFile>

Comment on lines 52 to 55
<!--
Our .nupkgproj files have conflicting names with src projects, which puts their intermediate
Expand All @@ -76,6 +77,10 @@
<Content Remove="$(PackagePreparationPath)$(PackageIdFolderName)\**\*.dbg" />
</ItemGroup>

<ItemGroup Condition="'$(PackageReadmeFile)' != ''">
<Content Include="$(MSBuildProjectDirectory)\README.md" Pack="true" PackagePath="" />
</ItemGroup>
Comment on lines +80 to +82

<!-- Work around https://github.com/NuGet/Home/issues/6091 -->
<ItemDefinitionGroup>
<PackageReference>
Expand Down
7 changes: 4 additions & 3 deletions pkg/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
</PropertyGroup>

<Target Name="GetTargetPath" Returns="@(_updatedTargetPath)">
<!-- Repoint up the TargetPath to represent the a matching file from PackagePreparationPath if it exists, otherwise don't return a target path
This fakes what the project output would be if we were using real projects (and not package projects) to represent these libraries. -->
<!-- Compute a fake target path from PackagePreparationPath so that ProjectReference consumers
can resolve a dependency. This replaces the TargetPathWithTargetPlatformMoniker-based approach
which is not available under Microsoft.Build.NoTargets. -->
<ItemGroup>
<_targetPathUnderPackagePrep Include="@(TargetPathWithTargetPlatformMoniker->'$(PackagePreparationPath)$(PackageIdFolderName)\lib\$(TargetFramework)\%(FileName)%(Extension)')" />
<_targetPathUnderPackagePrep Include="$(PackagePreparationPath)$(PackageIdFolderName)\lib\$(TargetFramework)\$(PackageIdFolderName).dll" />
<_updatedTargetPath Include="@(_targetPathUnderPackagePrep)" Condition="Exists('%(Identity)')" />
Comment on lines +10 to 15
</ItemGroup>
</Target>
Expand Down
25 changes: 25 additions & 0 deletions pkg/TorchAudio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# TorchAudio

TorchAudio provides .NET bindings for [torchaudio](https://pytorch.org/audio/), enabling audio processing and deep learning for audio tasks in .NET applications. Built on top of [TorchSharp](https://github.com/dotnet/TorchSharp).

## Installation

```shell
dotnet add package TorchAudio
```

You also need the TorchSharp package and a LibTorch runtime package:

```shell
dotnet add package TorchSharp
dotnet add package libtorch-cpu # or a CUDA variant
```

## Documentation

- [GitHub Repository](https://github.com/dotnet/TorchSharp)
- [TorchSharp API Documentation](https://dotnet.github.io/TorchSharp/)

## License

This project is licensed under the [MIT License](https://github.com/dotnet/TorchSharp/blob/main/LICENSE.txt).
2 changes: 1 addition & 1 deletion pkg/TorchAudio/TorchAudio.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
Expand Down
20 changes: 20 additions & 0 deletions pkg/TorchSharp-cpu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# TorchSharp-cpu

A convenience package that combines [TorchSharp](https://www.nuget.org/packages/TorchSharp) with [libtorch-cpu](https://www.nuget.org/packages/libtorch-cpu) for CPU-only inference and training across all supported platforms (Windows x64/ARM64, Linux x64, macOS ARM64).

## Installation

```shell
dotnet add package TorchSharp-cpu
```

This single package reference provides everything you need to run TorchSharp on CPU — no separate runtime package required.

## Documentation

- [GitHub Repository](https://github.com/dotnet/TorchSharp)
- [API Documentation](https://dotnet.github.io/TorchSharp/)

## License

This project is licensed under the [MIT License](https://github.com/dotnet/TorchSharp/blob/main/LICENSE.txt). LibTorch is redistributed under its own [license terms](https://github.com/dotnet/TorchSharp/blob/main/THIRD-PARTY-NOTICES.txt).
2 changes: 1 addition & 1 deletion pkg/TorchSharp-cpu/TorchSharp-cpu.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134">

<PropertyGroup>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
Expand Down
25 changes: 25 additions & 0 deletions pkg/TorchSharp-cuda-linux/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# TorchSharp-cuda-linux

A convenience package that combines [TorchSharp](https://www.nuget.org/packages/TorchSharp) with LibTorch CUDA 12.8 support for Linux x64.

## Installation

```shell
dotnet add package TorchSharp-cuda-linux
```

This single package reference provides everything you need to run TorchSharp with CUDA GPU acceleration on Linux x64 — no separate runtime package required.

## Requirements

- Linux x64
- NVIDIA GPU with CUDA 12.8 compatible drivers

## Documentation

- [GitHub Repository](https://github.com/dotnet/TorchSharp)
- [API Documentation](https://dotnet.github.io/TorchSharp/)

## License

This project is licensed under the [MIT License](https://github.com/dotnet/TorchSharp/blob/main/LICENSE.txt). LibTorch is redistributed under its own [license terms](https://github.com/dotnet/TorchSharp/blob/main/THIRD-PARTY-NOTICES.txt).
2 changes: 1 addition & 1 deletion pkg/TorchSharp-cuda-linux/TorchSharp-cuda-linux.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand Down
25 changes: 25 additions & 0 deletions pkg/TorchSharp-cuda-windows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# TorchSharp-cuda-windows

A convenience package that combines [TorchSharp](https://www.nuget.org/packages/TorchSharp) with LibTorch CUDA 12.8 support for Windows x64.

## Installation

```shell
dotnet add package TorchSharp-cuda-windows
```

This single package reference provides everything you need to run TorchSharp with CUDA GPU acceleration on Windows x64 — no separate runtime package required.

## Requirements

- Windows x64
- NVIDIA GPU with CUDA 12.8 compatible drivers

## Documentation

- [GitHub Repository](https://github.com/dotnet/TorchSharp)
- [API Documentation](https://dotnet.github.io/TorchSharp/)

## License

This project is licensed under the [MIT License](https://github.com/dotnet/TorchSharp/blob/main/LICENSE.txt). LibTorch is redistributed under its own [license terms](https://github.com/dotnet/TorchSharp/blob/main/THIRD-PARTY-NOTICES.txt).
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134">

<PropertyGroup>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
Expand Down
51 changes: 51 additions & 0 deletions pkg/TorchSharp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# TorchSharp

TorchSharp provides .NET bindings for [PyTorch](https://pytorch.org/), enabling .NET developers to build, train, and deploy deep learning models using the familiar PyTorch API.

## Installation

```shell
dotnet add package TorchSharp
```

You also need a LibTorch runtime package for your platform:

```shell
# CPU only (all platforms)
dotnet add package libtorch-cpu

# CUDA support (Linux)
dotnet add package libtorch-cuda-12.8-linux-x64

# CUDA support (Windows)
dotnet add package libtorch-cuda-12.8-win-x64
```

## Usage

```csharp
using TorchSharp;
using static TorchSharp.torch;

// Create tensors
var x = torch.randn(3, 4);
var y = torch.ones(3, 4);
var z = x + y;

// Build a model
var model = nn.Sequential(
nn.Linear(784, 128),
nn.ReLU(),
nn.Linear(128, 10)
);
```

## Documentation

- [GitHub Repository](https://github.com/dotnet/TorchSharp)
- [API Documentation](https://dotnet.github.io/TorchSharp/)
- [Developer Guide](https://github.com/dotnet/TorchSharp/blob/main/DEVGUIDE.md)

## License

This project is licensed under the [MIT License](https://github.com/dotnet/TorchSharp/blob/main/LICENSE.txt).
2 changes: 1 addition & 1 deletion pkg/TorchSharp/TorchSharp.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
Expand Down
25 changes: 25 additions & 0 deletions pkg/TorchVision/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# TorchVision

TorchVision provides .NET bindings for [torchvision](https://pytorch.org/vision/), enabling image transforms, datasets, and model architectures for computer vision in .NET applications. Built on top of [TorchSharp](https://github.com/dotnet/TorchSharp).

## Installation

```shell
dotnet add package TorchVision
```

You also need the TorchSharp package and a LibTorch runtime package:

```shell
dotnet add package TorchSharp
dotnet add package libtorch-cpu # or a CUDA variant
```

## Documentation

- [GitHub Repository](https://github.com/dotnet/TorchSharp)
- [TorchSharp API Documentation](https://dotnet.github.io/TorchSharp/)

## License

This project is licensed under the [MIT License](https://github.com/dotnet/TorchSharp/blob/main/LICENSE.txt).
2 changes: 1 addition & 1 deletion pkg/TorchVision/TorchVision.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
2 changes: 1 addition & 1 deletion pkg/libtorch-cpu-win-x64/libtorch-cpu-win-x64.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
22 changes: 22 additions & 0 deletions pkg/libtorch-cpu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# libtorch-cpu

Meta-package that references the platform-specific LibTorch CPU native library packages for all supported platforms (Windows x64/ARM64, Linux x64, macOS ARM64).

This is the CPU-only redistribution of [PyTorch LibTorch](https://pytorch.org/) native binaries, packaged for use with [TorchSharp](https://www.nuget.org/packages/TorchSharp).

## Installation

Most users should install [TorchSharp-cpu](https://www.nuget.org/packages/TorchSharp-cpu) instead, which bundles both TorchSharp and this package.

```shell
dotnet add package libtorch-cpu
```

## Documentation

- [GitHub Repository](https://github.com/dotnet/TorchSharp)
- [PyTorch](https://pytorch.org/)

## License

LibTorch is redistributed under its own [license terms](https://github.com/dotnet/TorchSharp/blob/main/THIRD-PARTY-NOTICES.txt).
2 changes: 1 addition & 1 deletion pkg/libtorch-cpu/libtorch-cpu.nupkgproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.Build.NoTargets/3.7.134" DefaultTargets="Pack">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
Expand Down
Loading
Loading