R Observatory
Search
install.packages("torch")
CRAN checks, method
OKnotes on 2 of 13
CRAN 30-day downloads, method
43,721−4% down on the 30 days before, the worse direction
Test coverage, method
0.3%of lines run by tests

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

Maintainer
Tomasz Kalinowski
Latest release
11 Apr 2026
First release
6 Aug 2020

Compare with another package

More details
Releases
32
Needs compilation
Yes
Config/build/copy-method
copy
RoxygenNote
7.3.3
SystemRequirements
LibTorch (https://pytorch.org/); Only x86_64 platforms are currently supported except for ARM system running macOS.
Task views (1)
Collections (1) Method, Collections
  • mlverse, in the mlverse organization on GitHub
Subjects (1) Method, Subjects
Cite

Package

Run in R for the authors' preferred citation:

citation("torch")
APA
Kalinowski, T., Badr, H. S., Damiani, A., Falbel, D., Fischer, S., Joachimiak, K., Luraschi, J., Pichler, M., RStudio, , Regouby, C., & Selivanov, D. (2026). torch: Tensors and Neural Networks with 'GPU' Acceleration (Version 0.17.0) [Computer software]. https://doi.org/10.32614/CRAN.package.torch
About

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA
Balamuta, J. J. (2026). R Observatory: Metrics for torch version 0.17.0 [Data set]. HJJB, LLC. Data release v2026-10-27. https://doi.org/10.5281/zenodo.21843040
About

From data release v2026-10-27, which the citation names so these numbers can be found later.

No warnings or errors. 2 of 13 check platforms have notes.

  • r-devel-linux-x86_64-debian-clang

    The unreleased R on Linux, x86_64, debian-clang

    Note

    Version checked
    0.17.0
    Time taken
    1,021 s

    Rd contents: Note

    Rd files without \usage:

    Full output

  • r-devel-linux-x86_64-debian-gcc

    The unreleased R on Linux, x86_64, debian-gcc

    Note

    Version checked
    0.17.0
    Time taken
    905 s

    Rd contents: Note

    Rd files without \usage:

    Full output

  • r-devel-linux-x86_64-fedora-clang

    The unreleased R on Linux, x86_64, fedora-clang

    OK

    Version checked
    0.17.0
    Time taken
    652 s
  • r-devel-linux-x86_64-fedora-gcc

    The unreleased R on Linux, x86_64, fedora-gcc

    OK

    Version checked
    0.17.0
    Time taken
    985 s
  • r-devel-windows-x86_64

    The unreleased R on Windows, x86_64

    OK

    Version checked
    0.17.0
    Time taken
    1,678 s
  • r-oldrel-macos-arm64

    The previous release of R on macOS, arm64

    OK

    Version checked
    0.17.0
    Time taken
    188 s
  • r-oldrel-macos-x86_64

    The previous release of R on macOS, x86_64

    OK

    Version checked
    0.17.0
    Time taken
    1,116 s
  • r-oldrel-windows-x86_64

    The previous release of R on Windows, x86_64

    OK

    Version checked
    0.17.0
    Time taken
    2,130 s
  • r-patched-linux-x86_64

    The patched release of R on Linux, x86_64

    OK

    Version checked
    0.17.0
    Time taken
    1,286 s
  • r-release-linux-x86_64

    The current release of R on Linux, x86_64

    OK

    Version checked
    0.17.0
    Time taken
    1,258 s
  • r-release-macos-arm64

    The current release of R on macOS, arm64

    OK

    Version checked
    0.17.0
    Time taken
    177 s
  • r-release-macos-x86_64

    The current release of R on macOS, x86_64

    OK

    Version checked
    0.17.0
    Time taken
    920 s
  • r-release-windows-x86_64

    The current release of R on Windows, x86_64

    OK

    Version checked
    0.17.0
    Time taken
    1,654 s
  • 2 Note
  • 11 OK
Check output (1)

Rd contents, Note on 2 platforms

Rd files without \usage:
  ‘torch_argmax.Rd’ ‘torch_argmin.Rd’ ‘torch_bincount.Rd’
  ‘torch_eig.Rd’ ‘torch_logical_not.Rd’ ‘torch_lstsq.Rd’
  ‘torch_matrix_rank.Rd’ ‘torch_max.Rd’ ‘torch_min.Rd’ ‘torch_sort.Rd’
\arguments should not be documented without \usage.
Extra checks (1)

Over time

No change since 11 Jul 2026

As a list (9)
ChangedWorst statusOKNotesWarningsErrors
11 Jul 2026Note12100
8 Jun 2026OK12000
7 Jun 2026Error12001
2 May 2026OK13000
22 Apr 2026Note11300
18 Apr 2026Error10301
16 Apr 2026Note11300
21 Mar 2026Warning6710
10 Mar 2026Note11300

Since March 2026

Check results on CRAN

Total downloads in the last 30 days
44,930−2.7% down on the 30 days before, the worse directionIt is the sum of 5 channels: CRAN, r2u, autoCRAN, conda-forge and c2d4u.

CRAN rank

527 of 26,529

CRAN

43,721 downloads in the last 30 days

Rank
527 of 26,529
Change
−4% down on the 30 days before, the worse direction

It is in the total. Take it out

r2u

485 downloads in the last 30 days

Rank
1,178 of 30,526
Change
+29.7% up on the 30 days before, the better direction

It is in the total. Take it out

autoCRAN

6 downloads in the last 30 days

Rank
8,099 of 29,212
Change
−70% down on the 30 days before, the worse direction

It is in the total. Take it out

conda-forge

682 downloads in the last 30 days

Rank
1,263 of 3,828
Change
+275% up on the 30 days before, the better direction

It is in the total. Take it out

c2d4u, no longer updated

36 downloads in the last 30 days

Rank
580 of 7,575
Change
no change on the 30 days before

It is in the total. Take it out

Over time

Compare downloads

Needs
18
Dependent packages
53
Suggested by
32
Needs (18)
Installing it adds
23 packages, 8.7 MB of source
Of those, need compilation
11
Optional extras (8)
Dependent packages (50 of 53)
PackageTitleDownloads in 30 days
mlr3torchDeep Learning with 'mlr3'2,970
torchvisionModels, Datasets and Transformations for Images2,726
citoBuilding and Training Neural Networks2,523
tabnetFit 'TabNet' Models for Classification and Regression2,236
torchvisionlibAdditional Operators for Image Models1,648
luzHigher Level 'API' for 'torch'1,583
bruleeHigh-Level Modeling Functions with 'torch'866
PLNmodelsPoisson Lognormal Models701
glmnetrNested Cross Validation for the Relaxed Lasso and Other Machine Learning Models687
sitsSatellite Image Time Series Analysis for Earth Observation Data Cubes631
innsightGet the Insights of Your Neural Network491
causalOTOptimal Transport Weights for Causal Inference486
torchdatasetsReady to Use Extra Datasets for Torch417
BKTRBayesian Kernelized Tensor Regression407
ARInfoLSTMARIMA-Informed LSTM for Time Series Forecasting368
engressionEngression Modelling364
proteusMultiform Seq2Seq Model for Time-Feature Analysis363
GARCHInfoLSTMGARCH-Informed LSTM Model for Volatility Forecasting362
ria.testTesting Equality of Natural Mediation Effects and Their Randomized Interventional Analogues351
pigautoFill in Missing Species Traits Using a Phylogenetic Tree343
EQRNExtreme Quantile Regression Neural Networks for Risk Forecasting319
madgrad'MADGRAD' Method for Stochastic Optimization302
funcmlFunctional Machine Learning Framework296
unfoldMapping Hidden Geometry into Future Sequences289
survdnnDeep Neural Networks for Survival Analysis with R 'torch'283
lambdaTSVariational Seq2Seq Model with Lambda Transformer for Time Series Analysis282
torchMAUMMulti-Class Area Under the Minimum in Torch274
scDHASingle-Cell Decomposition using Hierarchical Autoencoder271
FINNForest Informed Neural Networks270
topicmodels.etmTopic Modelling in Embedding Spaces269
whisperNative R 'torch' Implementation of 'OpenAI' 'Whisper'266
torchoptAdvanced Optimizers for Torch265
LBBNNLatent Binary Bayesian Neural Networks Using 'torch'257
kindlingHigher-Level Interface of 'torch' Package to Auto-Train Neural Networks256
chatterboxText-to-Speech Using the 'Chatterbox' Engine255
crumbleFlexible and General Mediation Analysis Using Riesz Representers250
rinetClinical Reference Interval Estimation with Reference Interval Network (RINet)249
shrinkGPRScalable Gaussian Process Regression with Hierarchical Shrinkage Priors237
snapSimple Neural Application231
diffuseRFunctional Interface to Diffusion Models in R229
survalisInterpretable Survival Machine Learning Framework223
spinnerAn Implementation of Graph Net Architecture Based on 'torch'219
circlusClustering and Simulation of Spherical Cauchy and PKBD Models218
n3dSpeaker Diarization with 'Nemotron 3 Diarization' in R 'torch'218
rkafKolmogorov-Arnold Fourier Networks in R216
SEMdeepStructural Equation Modeling with Deep Neural Network and Machine Learning Algorithms210
DICErClustDeep Significance Clustering for Clinical Risk Stratification187
temperTemporal Encoder-Masked Probabilistic Ensemble Regressor186
RGANGenerative Adversarial Nets (GAN) in R185
NNMoMoNeural Network Extension to 'StMoMo' for Lee-Carter Modeling181
Functions
15,072
Public exports
755
Lines of R code
102,571
Median complexity
1
Functions (15,072)
Size and composition

Lines by kind (228,721)

KindLinesShare
R code102,57145%
Tests11,8585%
Documentation30,39713%
Guides3,8722%
Compiled code80,02335%

Lines by language

LanguageLinesShare
R114,07450%
C++80,01335%
Rd30,34513%
Vignettes3,9242%
Markdown3550.2%
C100%

Languages are counted from file extensions.

Files
1,037
R functions
6,958
Compiled functions
8,122
Object systems
S3: 131 methods, R6: 59 classes
Complexity
Median
1
Mean
1.14
Highest
155
Median lines per function
3
About complexity

Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only.

Call graph figures
R functions
6,958
Calls
3,361
Unconnected
3,916
Groups
51
Growth (32 releases)
Total lines by release
113,492 on 6 Aug 2020228,721 on 11 Apr 2026
Release changes

The tests ran and coverage was measured.

Lines run by tests
0.3%
Expressions run by tests
0.5%
Test cases
735
Exports named in tests
46%
Coverage by file (96)
Coverage run
Lines counted
35,331
Lines the tests ran
0
Tests passed
Yes
Measured with
covr 3.6.5 on R 4.6.1
Test suite
Has tests
Yes
Test frameworks
testthat, tinytest
Test cases
735
Snapshot tests
15
Lines of tests
11,858
Test lines per line of code
0.12
Exports documented
99.9%
Arguments documented
100%
Return value documented
6.2%
Help pages with examples
63%
Examples run in checks
100%
Guides (1)
Other documentation
README
Yes, 117 words
Release notes file
Yes
Help pages
702
Lines of documentation
30,397

mlverse / torch on github.com

Stars
568−0.18% down on 30 days ago, the worse direction
Forks
93
Open issues
135
Last commit
23 Oct 2026
Activity
Commits
4,561
Open pull requests
13
Tagged releases
32
Latest tagged release
v0.17.0, 11 Apr 2026
In development
Default branch at 0.17.0.9000, ahead of CRAN 0.17.0 (checked 2026-10-25)
Issues closed in
14 days (median)
Pull requests closed in
1 day (median)
Pull requests merged
93%
Created
7 Jan 2020
Licence file reads as
–
Development practices (10)
KindFound
Continuous integrationGitHub Actions, R CMD check workflow
The R CMD check workflow runs on Linux, macOS and Windows
Governance and communityContributing guide
Docs sourceREADME.Rmd, pkgdown
GitHub Pages site last deployed 2026-10-23
The repository has a site deploy workflow
pkgdown site last built 2026-04-11
CRAN release processcran-comments.md, revdep/
Lint, format, editorRStudio project

Method, repository practices

Across mlverse

Claude Codeat least 10 crediting itClaude CodeFirst seen 26 Jan 2026at least 10 crediting it
Claude Opus 5.5Claude Opus 5.514 Oct 2026 to 22 Oct 20262 commits
Claude Opus 51MClaude Opus 51M context window5 Aug 20262 commits
Claude Opus 4.5Claude Opus 4.526 Jan 2026 to 8 Apr 20266 commits
GitHub Copilot1 commit by it and at least 1 crediting itGitHub CopilotFirst seen 26 Jan 20261 commit by itat least 1 crediting it

Tools

ToolFirst seenFoundCommits by itCommits crediting it
Claude Code26 Jan 2026Seen in the repository.claude.claude/skillsNamed in .Rbuildignore.claudePull request it wrote: opened by a project member10 at least
GitHub Copilot26 Jan 2026Pull request: opened by its own account11 at least
  • Seen in the repository
  • Named in .Rbuildignore
  • Pull request

Models

ModelContext windowCommitsFirst commitLast commitCredit lines of
Claude Opus 5.5214 Oct 202622 Oct 2026Claude Code
Claude Opus 51M25 Aug 20265 Aug 2026Claude Code
Claude Opus 4.5626 Jan 20268 Apr 2026Claude Code

Across mlverse

R releases
  • On CRAN
  • Archived
  • Release

Archived and back

ArchivedBackCRAN's reasonKind
13 Sep 202018 Sep 2020check issues still had not been correctedChecks not fixed
26 Aug 202031 Aug 2020check issues were not corrected in time. Installation failures with parallel makeChecks not fixed
VersionReleasedREvents
0.17.0 current11 Apr 20264.5.3Maintainer: Tomasz Kalinowski
0.16.32 Nov 20254.5.2
0.16.231 Oct 20254.5.2
0.16.116 Oct 20254.5.1
0.16.021 Aug 20254.5.1
0.15.110 Jul 20254.5.1
0.15.023 Jun 20254.5.1
0.14.214 Feb 20254.4.2
Earlier versions (24)
VersionReleasedREvents
0.14.13 Feb 20254.4.2
0.14.030 Jan 20254.4.2
0.13.022 May 20244.4.0
0.12.015 Dec 20234.3.2
0.11.06 Jun 20234.3.0
0.10.014 Apr 20234.2.3
0.9.123 Jan 20234.2.2
0.9.024 Oct 20224.2.1
0.8.119 Aug 20224.2.1
0.8.010 Jun 20224.2.0
0.7.226 Feb 20224.1.2
0.7.125 Feb 20224.1.2
0.7.018 Feb 20224.1.2
0.6.07 Oct 20214.1.1
0.5.017 Aug 20214.1.1
0.4.010 Jun 20214.1.0
0.3.028 Apr 20214.0.5
0.2.15 Jan 20214.0.3
0.2.015 Dec 20204.0.3
0.1.120 Oct 20204.0.3
0.1.028 Sep 20204.0.2
0.0.318 Sep 20204.0.2Back on CRAN 18 Sep 2020
0.0.231 Aug 20204.0.2Back on CRAN 31 Aug 2020
Archived 13 Sep 2020
“check issues still had not been corrected”
0.0.16 Aug 20204.0.2Archived 26 Aug 2020
“check issues were not corrected in time. Installation failures with parallel make”
Release notes (0.17.0)

Breaking changes

  • Updated to LibTorch 2.8.0 (#1419).
  • torch_triu_indices() and torch_tril_indices() now return 1-based indexes (#1382).
  • $indices() now returns 1-based indexes (#1382).

New features

  • Added torch_sitrep() for torch installation situation report (#1415, @cregouby).
  • Added %*% operator for torch tensors (#1379, @caio-hamamura).
  • Added head() and tail() methods for torch tensors (#1388).
  • Exported torch_scaled_dot_product_attention() (#1404).
  • Exported torch_sparse_sampled_addmm() (#1427).
  • Exported torch_ldexp() (#1407).
  • Integrated cudatoolkit R package for CUDA library loading (#1422).
  • Improved as_array() support for sparse tensors (#1387).

Bug fixes

  • Fixed sparse CSR tensor printing, to_sparse() crash, and as_array() detection (#1431).
  • Fixed dataset()/nn_module() crash when initialize parameter is named d (#1424, @Chandraveer-Singh).
  • Fixed bfloat16 not being recognized as a floating point dtype (#1408).
  • Fixed handling of R longjump exceptions in autograd and tracing callbacks (#1406).
  • Fixed redundant lantern.h include causing macro redefinition warning (#1430).
  • Excluded glibc libraries from dependency bundling (#1397, @troyhernandez).
  • Replaced non-API entry point Rf_findVarInFrame with R_getVarEx for R 4.6 compatibility (#1421).
  • Added French translations for 5 missing messages (#1385, @cregouby).