# dotnet/TorchSharp

A .NET library that provides access to the library that powers PyTorch.

Repository: https://github.com/dotnet/TorchSharp
Canonical: https://ross.abutalabs.com/products/torchsharp
Language: C#
License: MIT
License Family: permissive
Topics: libtorch, mlnet, torchsharp, torchscript
Last push: 2026-07-03T12:41:37+00:00

## Health v2 (maintenance only)
Score: 73/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 90, release rhythm 35, longevity 100
- inputs: {"age_days": 2882, "days_push": 61, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1850, forks 228 (observed 2026-08-28T04:05:44.307098+00:00)

## What it is
TorchSharp is a .NET library providing bindings to LibTorch, the library that powers PyTorch, with a focus on tensors and a PyTorch-like API. It is a wrapper library maintained under the .NET Foundation, with companion TorchAudio and TorchVision packages.

## Use cases
- train neural networks in C# or F#
- run PyTorch models from a .NET application
- perform tensor math with GPU acceleration in .NET
- load TorchScript models for inference in .NET
- build computer vision or audio ML pipelines in C#

## When to choose
- you want PyTorch-style deep learning while staying in the .NET ecosystem
- you need to deploy ML inference inside existing C#/.NET services
- you prefer static typing and .NET tooling over Python

## When to avoid
- you need the full PyTorch ecosystem of Python-only libraries and tooling
- you are on Intel-based macOS, which is no longer supported
- you want a fully stable API - breaking changes may occur before v1.0

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, deep-learning, gpu-computing
- domain: machine-learning, deep-learning, cross-platform
- platform: dotnet, windows
- tags: libtorch, pytorch, tensors, torchscript, csharp, fsharp, nuget, linux, macos, gpu

## Member repositories
- dotnet/TorchSharp (main) score 73

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:44.307098+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:16:57.292728+00:00, confidence not recorded.
  - readme: https://github.com/dotnet/TorchSharp (fetched 2026-08-28T04:05:44.307098+00:00, sha 5c79c0dd4bee)
- Data as of 2026-08-30T08:39:29.467469+00:00.
