Learn R Programming

rTorch (version 0.4.2)

install_pytorch: Install PyTorch and its dependencies

Description

Install PyTorch and its dependencies

Usage

install_pytorch(
  method = c("conda", "virtualenv", "auto"),
  conda = "auto",
  version = "default",
  envname = "r-torch",
  extra_packages = NULL,
  restart_session = TRUE,
  conda_python_version = "3.6",
  pip = FALSE,
  channel = "stable",
  cuda_version = NULL,
  dry_run = FALSE,
  ...
)

Arguments

method

Installation method. By default, "auto" automatically finds a method that will work in the local environment. Change the default to force a specific installation method. Note that the "virtualenv" method is not available on Windows (as this isn't supported by PyTorch). Note also that since this command runs without privillege the "system" method is available only on Windows.

conda

The path to a conda executable. Use "auto" to allow reticulate to automatically find an appropriate conda binary. See Finding Conda for more details.

version

PyTorch version to install. The "default" version is 1.4. You can specify a specific PyTorch version with version="1.2", or version="1.6".

envname

Name of Python or conda environment to install within. The default environment name is r-torch.

extra_packages

Additional Python packages to install along with PyTorch. If more than one package use a character vector: c("pandas", "matplotlib").

restart_session

Restart R session after installing (note this will only occur within RStudio).

conda_python_version

the Python version installed in the created conda environment. Python 3.4 is installed by default. But you could specify for instance: conda_python_version="3.7".

pip

logical

channel

conda channel. The default channel is stable. The alternative channel is nightly.

cuda_version

string for the cuda toolkit version to install. For example, to install a specific CUDA version use cuda_version="10.2".

dry_run

logical, set to TRUE for unit tests, otherwise will execute the command.