torch: Tensors and Neural Networks with 'GPU' Acceleration

Provides functionality to define and train neural networks similar to 'PyTorch' by Paszke et al (2019) <arXiv:1912.01703> but written entirely in R using the 'libtorch' library. Also supports low-level tensor operations and 'GPU' acceleration.

Version: 0.11.0
Imports: Rcpp, R6, withr, rlang, methods, utils, stats, bit64, magrittr, tools, coro (≥ 1.0.2), callr, cli (≥ 3.0.0), glue, ellipsis, desc
LinkingTo: Rcpp
Suggests: testthat (≥ 3.0.0), covr, knitr (≥ 1.36), rmarkdown, palmerpenguins, mvtnorm, numDeriv, katex
Published: 2023-06-06
Author: Daniel Falbel [aut, cre, cph], Javier Luraschi [aut], Dmitriy Selivanov [ctb], Athos Damiani [ctb], Christophe Regouby [ctb], Krzysztof Joachimiak [ctb], Hamada S. Badr [ctb], RStudio [cph]
Maintainer: Daniel Falbel <daniel at>
License: MIT + file LICENSE
NeedsCompilation: yes
SystemRequirements: LibTorch (; Only x86_64 platforms are currently supported except for ARM system running macOS.
Materials: README NEWS
In views: MachineLearning
CRAN checks: torch results


Reference manual: torch.pdf
Vignettes: Distributions
Extending Autograd
Indexing tensors
Loading data
Python to R
Creating tensors
Using autograd


Package source: torch_0.11.0.tar.gz
Windows binaries: r-devel:, r-release:, r-oldrel:
macOS binaries: r-release (arm64): torch_0.11.0.tgz, r-oldrel (arm64): torch_0.11.0.tgz, r-release (x86_64): torch_0.11.0.tgz, r-oldrel (x86_64): torch_0.11.0.tgz
Old sources: torch archive

Reverse dependencies:

Reverse imports: brulee, cito, engression, glmnetr, innsight, lambdaTS, luz, madgrad, PLNmodels, proteus, RGAN, scDHA, SCFA, sits, spinner, tabnet, topicmodels.etm, torchaudio, torchdatasets, torchopt, torchvision, torchvisionlib
Reverse linking to: torchvisionlib
Reverse suggests: bundle, GPUmatrix, safetensors, targets, vetiver


Please use the canonical form to link to this page.