hasktorch: Haskell bindings to libtorch, supporting both typed and untyped tensors.
Hasktorch is a library for tensors and neural networks in Haskell. It is an independent open source community project which leverages the core C++ libraries shared by PyTorch.
Modules
[Index] [Quick Jump]
- Torch
- Torch.Autograd
 - Torch.Backend
 - Torch.Cast
 - Torch.DType
 - Torch.Data
 - Torch.Device
 - Torch.Dimname
 - Distributions
 - Torch.Functional
 - Torch.HList
 - Torch.Index
 - Torch.Initializers
 - Torch.Jit
 - Torch.Layout
 - Torch.Lens
 - Torch.NN
 - Torch.Optim
 - Torch.Random
 - Torch.Scalar
 - Torch.Script
 - Torch.Serialize
 - Torch.Tensor
 - Torch.TensorFactories
 - Torch.TensorOptions
 - Torch.Tutorial
 - Torch.Typed
- Torch.Typed.Autograd
 - Torch.Typed.Auxiliary
 - Torch.Typed.DType
 - Torch.Typed.Device
 - Torch.Typed.Factories
 - Torch.Typed.Functional
 - Torch.Typed.Lens
 - Torch.Typed.NN
 - Torch.Typed.NamedTensor
 - Torch.Typed.Optim
 - Torch.Typed.Parameter
 - Torch.Typed.Serialize
 - Torch.Typed.Tensor
 - Torch.Typed.VLTensor
 - Torch.Typed.Vision
 
 - Torch.Vision
 
 
Flags
Manual Flags
| Name | Description | Default | 
|---|---|---|
| disable-doctest | Disable doctest. ToDo: This flag is to avoid relocation-error of ghci for macos.  | Disabled | 
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- hasktorch-0.2.1.7.tar.gz [browse] (Cabal source package)
 - Package description (as included in the package)
 
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.0.1.0, 0.2.0.0, 0.2.0.1, 0.2.1.0, 0.2.1.1, 0.2.1.2, 0.2.1.3, 0.2.1.4, 0.2.1.6, 0.2.1.7 | 
|---|---|
| Dependencies | array (>=0.5.5 && <0.6), async (>=2.2.5 && <2.3), base (>=4.7 && <5), bytestring (>=0.11.5 && <0.13), cassava (>=0.5.3 && <0.6), constraints (>=0.14 && <0.15), containers (>=0.6.7 && <0.8), data-default-class (>=0.1 && <0.3), deepseq (>=1.4.8 && <1.6), finite-typelits (>=0.1 && <0.3), foldl (>=1.4 && <1.5), ghc-typelits-extra (>=0.4.6 && <0.5), ghc-typelits-knownnat (>=0.7.9 && <0.8), ghc-typelits-natnormalise (>=0.7.9 && <0.8), half (>=0.3 && <0.4), inline-c (>=0.9.1 && <0.10), JuicyPixels (>=3.3 && <3.4), lens-family-core (>=2.1.3 && <2.2), libtorch-ffi (>=2.0.1 && <2.0.2), libtorch-ffi-helper (>=2.0.0 && <2.0.1), lifted-async (>=0.10.2 && <0.11), megaparsec (>=9.5 && <9.8), monad-control (>=1.0.3 && <1.1), mtl (>=2.3.1 && <2.4), pipes (>=4.3.16 && <4.4), pipes-bytestring (>=2.1.7 && <2.2), pipes-concurrency (>=2.0.14 && <2.1), pipes-csv (>=1.4.3 && <1.5), pipes-group (>=1.0.12 && <1.1), pipes-safe (>=2.3.5 && <2.4), random (>=1.2.1 && <1.3), reflection (>=2.1 && <2.2), safe-exceptions (>=0.1.7 && <0.2), stm (>=2.5.1 && <2.6), template-haskell (>=2.20.0 && <2.23), transformers-base (>=0.4.6 && <0.5), vector (>=0.13 && <0.14), vector-sized (>=1.5 && <1.7), zlib (>=0.6 && <0.8) [details] | 
| License | BSD-3-Clause | 
| Copyright | 2019 Austin Huang | 
| Author | Hasktorch Contributor Team | 
| Maintainer | hasktorch@gmail.com | 
| Category | Codegen | 
| Home page | https://github.com/hasktorch/hasktorch#readme | 
| Uploaded | by junjihashimoto at 2025-10-21T20:25:05Z | 
| Distributions | NixOS:0.2.1.3 | 
| Reverse Dependencies | 2 direct, 0 indirect [details] | 
| Downloads | 1111 total (27 in the last 30 days) | 
| Rating | (no votes yet) [estimated by Bayesian average] | 
| Your Rating | |
| Status | Docs available [build log] Last success reported on 2025-10-22 [all 4 reports]  |