Learn R Programming

torch (version 0.9.1)

get_install_libs_url: Install Torch from files

Description

List the Torch and Lantern libraries URLs to download as local files in order to proceed with install_torch_from_file().

Installs Torch and its dependencies from files.

Usage

get_install_libs_url(
  version = "1.12.1",
  type = install_type(version = version)
)

install_torch_from_file( version = "1.12.1", type = install_type(version = version), libtorch, liblantern, ... )

Arguments

version

The Torch version to install.

type

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

libtorch

The installation archive file to use for Torch. Shall be a "file://" URL scheme.

liblantern

The installation archive file to use for Lantern. Shall be a "file://" URL scheme.

...

other parameters to be passed to "install_torch()"

Details

When "install_torch()" initiated download is not possible, but installation archive files are present on local filesystem, "install_torch_from_file()" can be used as a workaround to installation issue. "libtorch" is the archive containing all torch modules, and "liblantern" is the C interface to libtorch that is used for the R package. Both are highly dependent, and should be checked through "get_install_libs_url()"

Examples

Run this code
if (torch_is_installed()) {
if (FALSE) {
# on a linux CPU platform 
get_install_libs_url(type = "cpu")
# then after making both files available into /tmp/
install_torch_from_file(
  libtorch = "file:////tmp/libtorch-cxx11-abi-shared-with-deps-1.12.1%2Bcpu.zip",
  liblantern = "file:////tmp/Linux-cpu.zip"
)
}
}

Run the code above in your browser using DataLab