ds5678 304f3c0e92 Enable XML docs generation and suppress warning 1591
Added <GenerateDocumentationFile> to generate XML docs during build. Suppressed warning 1591 for missing XML comments on public members using <NoWarn>.
2026-09-08 15:13:24 -07:00
2026-05-08 15:25:11 -07:00
2025-11-17 13:44:17 -08:00
2025-11-17 13:44:17 -08:00
2025-12-06 21:52:53 -08:00
2026-09-08 14:28:29 -07:00
2026-09-08 15:02:33 -07:00
2026-09-08 15:02:33 -07:00
2025-11-17 13:44:17 -08:00
2025-12-10 20:57:09 -08:00

AssetRipper.Bindings.LibTorchSharp

This is an alternate binding library for LibTorchSharp, the native library portion of TorchSharp.

Differences from TorchSharp

This opinionated library requires unwavering vigilance to memory management, in exchange for maximum performance. Here be dragons.

.NET 10

This library is built targeting .NET 10, while TorchSharp multi-targets older versions, including .NET Standard 2.0.

Allocations

TorchSharp relies on the garbage collector to protect against native memory leaks. This library eliminates managed allocations by relying on users to dispose any native objects they create.

using Tensor tensor = new Tensor([1, 2, 3]);

Level of abstraction

This library exposes the native API directly and also offers a more user-friendly layer over top of that. TorchSharp is high-level and tries to mirror the PyTorch API almost exactly.

Maintenance

Most of this library is procedurally generated.

  • ClangSharp is used to generate the low-level interop code.
  • A custom Roslyn source generator is used to create a mid-level layer on top of the interop code.

TorchSharp includes some hand-written C# code. Nearly all of that functionality is omitted from this library.

Documentation

Procedurally generated code is not documented in this library. Users should refer to the TorchSharp source code or the official PyTorch documentation.

S
Description
Alternate bindings for LibTorchSharp
Readme MIT
343 KiB
0 Stars 1 Watchers 0 Forks
Languages
C# 84%
C 15.7%
C++ 0.3%