install_torch: Install Torch

View source: R/install.R

install_torchR Documentation

Install Torch


Installs Torch and its dependencies.


  version = "1.12.1",
  type = install_type(version = version),
  reinstall = FALSE,
  path = install_path(),
  timeout = 360,



The Torch version to install.


The installation type for Torch. Valid values are "cpu" or the 'CUDA' version.


Re-install Torch even if its already installed?


Optional path to install or check for an already existing installation.


Optional timeout in seconds for large file download.


other optional arguments (like `load` for manual installation).


When using path to install in a specific location, make sure the TORCH_HOME environment variable is set to this same path to reuse this installation. The TORCH_INSTALL environment variable can be set to 0 to prevent auto-installing torch and TORCH_LOAD set to 0 to avoid loading dependencies automatically. These environment variables are meant for advanced use cases and troubleshooting only. When timeout error occurs during library archive download, or length of downloaded files differ from reported length, an increase of the timeout value should help.

Setting the environmanet variable PRECXX11ABI=1 will trigger the installation of a Pre-cxx11 ABI installation of LibTorch. This can be useful in environments with older versions of GLIBC like CentOS7 and older Debian/Ubuntu versions.

torch documentation built on Jan. 24, 2023, 1:05 a.m.