Skip to content

torch

0.17.0Package record

Tensors and Neural Networks with 'GPU' Acceleration

53packages dependsuggested by 33
284.4Kdownloads / year
0.3%test coverage
11/13flavors OK

Overview

About

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.

Changes in 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).
Show all changes in 0.17.0Hide the rest of the changes in 0.17.0
  • 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).

From NEWS.md in the release

Install

Health

CRAN checks
2NOTE11OK
Check messages
NOTERd contentsr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
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.
Additional issues

CRAN check page ↗

Slowest check: 35.2 min · r-oldrel-windows-x86_64
Status changes
  • NOTE11 OK, 2 NOTENow
  • NOTE12 OK, 1 NOTE2026-07-11
  • OK12 OK, 1 FAILURE2026-06-08
  • ERROR12 OK, 1 ERROR2026-06-07
  • OK13 OK2026-05-02
  • NOTE11 OK, 3 NOTE2026-04-22
Show 4 earlier changesHide 4 earlier changes
  • ERROR10 OK, 3 NOTE, 1 ERROR2026-04-18
  • NOTE11 OK, 3 NOTE2026-04-16
  • WARNING6 OK, 7 NOTE, 1 WARNING2026-03-21
  • NOTE11 OK, 3 NOTE2026-03-10
Advisories

none known

Documentation

In release 0.17.0
READMEYes · 117 wordsVignettesYes · 1 · staticNEWSYes · 100% structured · mentions 0.17.0Citation fileNoWebsiteYes · pkgdown

The repository also keeps web-only articles.

Help pages
702 (4 internal)
Examples that run
100%442 run in a plain check (1 of them under a condition)
Exported functions with examples
64%
Documented parameters
100%
Return-value docs
6%
Help pages citing references
0%
Vignettes (1)

Downloads

284.4K
CRAN downloads in the past year
Rank #521 · ~779/day · ~23.7K/mo
Daily download trend is not available in this view yet.
44.4K30 days
137.5K90 days
284.4K1 year
Compare downloads with other packages →
Also on4K r2u5 autocran6.7K conda_forge192 c2d4u

Repository

569Stars
93Forks
143Open issues
16Open PRs
32Releases
4,554Commits
58Commit identities
torchautograddeep-learningr
4,554 commits · Last activity 2026-10-21 · +0.2% stars, 30d · Default branch at 0.17.0.9000, ahead of CRAN 0.17.0 (checked 2026-10-18)
Responsiveness
How these are sampled
PRs merged (all time)
93%
Median days to close, 50 most recently updated closed issues
5
Median days to close, 50 most recently updated closed PRs
1

Stars over time

2025-10-16 · 5452026-10-22 · 569
PracticesBeta

10 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/mlverse/torch on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows

Governance and community (1)
Contributing guide
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-14 · The repository has a site deploy workflow

pkgdown site last built 2026-04-11

CRAN release process (2)
cran-comments.mdrevdep/
Show all practicesHide 1 practice
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-01-26
    Seen in the repository: .claude, .claude/skills
    Named in .Rbuildignore: .claude
    Pull request it wrote: opened by a project member
    Commits: at least 9 crediting it in the message
  • GitHub Copilotfirst seen 2026-01-26
    Pull request: opened by its own account
    Commits: 1 by its own account · at least 1 crediting it in the message
From outside contributors
  • Claude Code
    Pull requests: 2 from outside contributors, first on 2026-01-12, 2 from forks
Models named in its commits
  • Claude Opus 4.56 commits · Jan to Apr 2026
  • Claude Opus 52 commits · Aug 2026
  • Claude Opus 5.51 commit · Oct 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
23 external dependencies (excludes base and recommended)

Installing torch adds 23 packages (11 with compiled code, 8.7 MB of source tarballs). Heaviest: Rcpp 1.8 MB, farver 1.2 MB, viridisLite 1.2 MB.

Depends (0)
none
LinkingTo (1)
Enhances (0)
none

People & History

People (11)
Contributor, Maintainer since 0.17.0 (2026) · added in 0.17.0
Author, Copyright holder
Contributor · added in 0.7.0
Contributor
Contributor · added in 0.13.0
Contributor · added in 0.3.0
Contributor · added in 0.14.0
Contributor · added in 0.3.0
Copyright holder

Previously maintained by Daniel Falbel (0.0.1 to 0.16.3).

Releases (32)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.17.0Latest
    record
    2026-04-11 · current release · diff ↗ ·
    added 6 exports
    install_torch_sitrep, torch_float8_e4m3fn, torch_float8_e5m2, torch_ldexp, torch_scaled_dot_product_attention, torch_sparse_sampled_addmm
  • 0.16.3
    record
    2025-11-02 · diff ↗
  • 0.16.2
    record
    2025-10-31 · diff ↗
  • 0.16.1
    record
    2025-10-16 · diff ↗
  • 0.16.0
    record
    2025-08-21 · diff ↗
  • 0.15.1
    record
    2025-07-10 · diff ↗
  • 0.15.0
    record
    2025-06-23 · diff ↗ ·
    added 8 exports
    cuda_dump_memory_snapshot, cuda_memory_snapshot, cuda_record_memory_history, nn_aum_loss, nn_transformer_encoder, nn_transformer_encoder_layer, nnf_area_under_min_fpr_fnr, torch_bfloat16
  • R
    R 4.5.0 released · 2025-04-11
  • 0.14.2
    record
    2025-02-14 · diff ↗
  • 0.14.1
    record
    2025-02-03 · diff ↗
  • 0.14.0
    record
    2025-01-30 · diff ↗ ·
    added 11 exports
    OptimizerIgnite, jit_serialize, jit_unserialize, optim_ignite_adagrad, optim_ignite_adam, optim_ignite_adamw, optim_ignite_rmsprop, optim_ignite_sgd, optim_required, optimizer_ignite, torch_take_along_dim
  • 0.13.0
    record
    2024-05-22 · diff ↗ ·
    added 4 exports
    clone_module, linalg_solve_triangular, set_autocast, unset_autocast
  • R
    R 4.4.0 released · 2024-04-24
  • 0.12.0
    record
    2023-12-15 · diff ↗ ·
    removed 1 export
    torch_symeig
    added 5 exports
    iterable_dataset, lr_cosine_annealing, torch_cfloat128, torch_chalf, torch_serialize
  • 0.11.0
    record
    2023-06-06 · diff ↗ ·
    added 12 exports
    buffer_from_torch_tensor, cuda_get_rng_state, cuda_set_rng_state, jit_ops, local_device, local_torch_manual_seed, nn_module_dict, nn_utils_weight_norm, torch_set_rng_state, torch_tensor_from_buffer, with_device, with_torch_manual_seed
Show 27 earlier eventsHide 27 earlier events
  • R
    R 4.3.0 released · 2023-04-21
  • 0.10.0
    record
    2023-04-14 · diff ↗ ·
    removed 3 exports
    torch_eig, torch_lstsq, torch_matrix_rank
    added 9 exports
    cuda_amp_grad_scaler, local_autocast, local_enable_grad, local_no_grad, nn_silu, nnf_silu, optim_adamw, torch_get_rng_state, with_autocast
  • 0.9.1
    record
    2023-01-23 · diff ↗ ·
    added 1 export
    torch_fft_fftfreq
  • 0.9.0
    record
    2022-10-24 · diff ↗ ·
    removed 1 export
    torch_solve
    added 3 exports
    backends_mps_is_available, cuda_empty_cache, cuda_synchronize
  • 0.8.1
    record
    2022-08-19 · diff ↗
  • 0.8.0
    record
    2022-06-10 · diff ↗ ·
    added 10 exports
    lr_reduce_on_plateau, nn_embedding_bag, nn_prune_head, sampler, torch_cdouble, torch_cfloat, torch_cfloat32, torch_cfloat64, torch_kron, torch_lu_unpack
  • R
    R 4.2.0 released · 2022-04-22
  • 0.7.2
    record
    2022-02-26 · diff ↗
  • 0.7.1
    record
    2022-02-25 · diff ↗ ·
    added 1 export
    cuda_runtime_version
  • 0.7.0
    record
    2022-02-18 · diff ↗ ·
    added 11 exports
    backends_cudnn_is_available, backends_cudnn_version, call_torch_function, cuda_get_device_capability, cuda_memory_stats, cuda_memory_summary, jit_save_for_mobile, nn_flatten, nn_unflatten, nn_upsample, torch_install_path
  • 0.6.0
    record
    2021-10-07 · diff ↗
  • 0.5.0
    record
    2021-08-17 · diff ↗ ·
    added 36 exports
    contrib_sort_vertices, jit_compile, jit_scalar, jit_trace_module, jit_tuple, linalg_cholesky, linalg_cholesky_ex, linalg_cond, linalg_det, linalg_eig, linalg_eigh, linalg_eigvals, linalg_eigvalsh, linalg_householder_product, linalg_inv, linalg_inv_ex, linalg_lstsq, linalg_matrix_norm, linalg_matrix_power, linalg_matrix_rank, linalg_multi_dot, linalg_norm, linalg_pinv, linalg_qr, linalg_slogdet, linalg_solve, linalg_svd, linalg_svdvals, linalg_tensorinv, linalg_tensorsolve and 6 more
  • 0.4.0
    record
    2021-06-10 · diff ↗ ·
    added 4 exports
    distr_categorical, distr_mixture_same_family, distr_multivariate_normal, torch_diff
  • R
    R 4.1.0 released · 2021-05-18
  • 0.3.0
    record
    2021-04-28 · diff ↗ ·
    removed 4 exports
    torch_fft, torch_ifft, torch_irfft, torch_rfft
    added 17 exports
    backends_mkl_is_available, backends_mkldnn_is_available, backends_openmp_is_available, distr_bernoulli, distr_chi2, distr_gamma, distr_normal, distr_poisson, get_install_libs_url, install_torch_from_file, nn_group_norm, nn_layer_norm, optimizer, torch_fft_fft, torch_fft_ifft, torch_fft_irfft, torch_fft_rfft
  • 0.2.1
    record
    2021-01-05 · diff ↗
  • 0.2.0
    record
    2020-12-15 · diff ↗ ·
    added 88 exports
    as_iterator, dataset_subset, jit_load, jit_save, jit_trace, loop, nn_batch_norm3d, nn_gru, nn_lstm, optim_lbfgs, torch_absolute, torch_acosh, torch_amax, torch_amin, torch_arccos, torch_arccosh, torch_arcsin, torch_arcsinh, torch_arctan, torch_arctanh, torch_asinh, torch_atanh, torch_atleast_1d, torch_atleast_2d, torch_atleast_3d, torch_block_diag, torch_bucketize, torch_channel_shuffle, torch_clip, torch_clone and 58 more
  • 0.1.1
    record
    2020-10-20 · diff ↗ ·
    added 14 exports
    nn_contrib_sparsemax, nn_utils_clip_grad_norm_, nn_utils_clip_grad_value_, nnf_contrib_sparsemax, optim_adadelta, optim_adagrad, optim_asgd, optim_rmsprop, optim_rprop, torch_get_num_interop_threads, torch_get_num_threads, torch_scalar_tensor, torch_set_num_interop_threads, torch_set_num_threads
  • 0.1.0
    record
    2020-09-28 · diff ↗ ·
    added 30 exports
    is_nn_buffer, is_nn_module, is_nn_parameter, is_optimizer, lr_lambda, lr_multiplicative, lr_one_cycle, lr_scheduler, lr_step, nn_bce_with_logits_loss, nn_buffer, nn_cosine_embedding_loss, nn_ctc_loss, nn_hinge_embedding_loss, nn_kl_div_loss, nn_l1_loss, nn_margin_ranking_loss, nn_mse_loss, nn_multi_margin_loss, nn_multilabel_margin_loss, nn_multilabel_soft_margin_loss, nn_nll_loss, nn_pairwise_distance, nn_parameter, nn_poisson_nll_loss, nn_smooth_l1_loss, nn_soft_margin_loss, nn_triplet_margin_loss, nn_triplet_margin_with_distance_loss, nnf_triplet_margin_with_distance_loss
  • unarchivedReturned to CRAN
    2020-09-18
  • 0.0.3
    record
    2020-09-18 · diff ↗ ·
    added 6 exports
    %>%, is_torch_device, is_undefined_tensor, torch_celu, torch_relu, torch_selu
  • archivedRemoved from CRAN
    2020-09-13
    check issues still had not been corrected
  • unarchivedReturned to CRAN
    2020-08-31
  • 0.0.2
    record
    2020-08-31 · diff ↗ ·
    added 22 exports
    load_state_dict, nn_adaptive_avg_pool1d, nn_adaptive_avg_pool2d, nn_adaptive_avg_pool3d, nn_adaptive_max_pool1d, nn_adaptive_max_pool2d, nn_adaptive_max_pool3d, nn_avg_pool1d, nn_avg_pool2d, nn_avg_pool3d, nn_fractional_max_pool2d, nn_fractional_max_pool3d, nn_lp_pool1d, nn_lp_pool2d, nn_max_pool3d, nn_max_unpool1d, nn_max_unpool2d, nn_max_unpool3d, nnf_sigmoid, torch_finfo, torch_iinfo, torch_manual_seed
  • archivedRemoved from CRAN
    2020-08-26
    check issues were not corrected in time Installation failures with parallel make
  • 0.0.1
    record
    2020-08-06
  • R
    R 4.0.0 released · 2020-04-24

Package metadata

First published
2020-08-06
Total releases
32 / 6 yrs
License
MIT + file LICENSE OSI
Download size
1.9 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("torch")
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

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

Cite the 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-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy