Aleator.Torch
0.3.0-preview.1
dotnet add package Aleator.Torch --version 0.3.0-preview.1
NuGet\Install-Package Aleator.Torch -Version 0.3.0-preview.1
<PackageReference Include="Aleator.Torch" Version="0.3.0-preview.1" />
<PackageVersion Include="Aleator.Torch" Version="0.3.0-preview.1" />
<PackageReference Include="Aleator.Torch" />
paket add Aleator.Torch --version 0.3.0-preview.1
#r "nuget: Aleator.Torch, 0.3.0-preview.1"
#:package Aleator.Torch@0.3.0-preview.1
#addin nuget:?package=Aleator.Torch&version=0.3.0-preview.1&prerelease
#tool nuget:?package=Aleator.Torch&version=0.3.0-preview.1&prerelease
Aleator.Torch
Optional TorchSharp bridge for Aleator, the .NET 10 / C# port of the Figaro probabilistic programming library.
TorchDifferentiableTarget(dimension, tensorProgram)wraps any TorchSharp tensor program as anIDifferentiableTarget, so Aleator's gradient engines (HMC / NUTS / ADVI / SVGD from Aleator.AutoDiff) consume libtorch log-densities — including neural-network likelihoods and VAE-style amortised encoders.TorchProbe.Describe()— native-backend smoke check.
using Aleator.AutoDiff;
using Aleator.Torch;
using Aleator.Util;
using static TorchSharp.torch;
var target = new TorchDifferentiableTarget(3, theta => -0.5 * (theta * theta).sum());
var nuts = new NoUTurnSampler(target, random: new DefaultRandomSource(42));
Each bridge call owns and disposes the input tensor and all callback temporaries. Tensors captured by the callback
(for example model parameters or fixed data) remain caller-owned. Gradient evaluation uses input-only
autograd.grad, so it does not accumulate .grad on captured trainable tensors.
Carries the heavy TorchSharp + libtorch-cpu native dependency (hundreds of MB) — reference it
only when you need the bridge. Excluded from NativeAOT publishes by design.
Docs and examples (torch-bridge, amortised-vi):
github.com/deecalov/Aleator.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Aleator.AutoDiff (>= 0.3.0-preview.1)
- Aleator.Core (>= 0.3.0-preview.1)
- libtorch-cpu (>= 2.10.0)
- System.Numerics.Tensors (>= 10.0.9)
- TorchSharp (>= 0.106.0)
-
net8.0
- Aleator.AutoDiff (>= 0.3.0-preview.1)
- Aleator.Core (>= 0.3.0-preview.1)
- libtorch-cpu (>= 2.10.0)
- System.Numerics.Tensors (>= 10.0.9)
- TorchSharp (>= 0.106.0)
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 |
|---|---|---|
| 0.3.0-preview.1 | 67 | 9/6/2026 |