Learn R Programming

torch

Installation

torch can be installed from CRAN with:

install.packages("torch")

You can also install the development version with:

remotes::install_github("mlverse/torch")

At the first package load additional software will be installed. See also the full installation guide here.

Examples

You can create torch tensors from R objects with the torch_tensor function and convert them back to R objects with as_array.

library(torch)
x <- array(runif(8), dim = c(2, 2, 2))
y <- torch_tensor(x, dtype = torch_float64())
y
#> torch_tensor
#> (1,.,.) = 
#>   0.6192  0.5800
#>   0.2488  0.3681
#> 
#> (2,.,.) = 
#>   0.0042  0.9206
#>   0.4388  0.5664
#> [ CPUDoubleType{2,2,2} ]
identical(x, as_array(y))
#> [1] TRUE

Simple Autograd Example

In the following snippet we let torch, using the autograd feature, calculate the derivatives:

x <- torch_tensor(1, requires_grad = TRUE)
w <- torch_tensor(2, requires_grad = TRUE)
b <- torch_tensor(3, requires_grad = TRUE)
y <- w * x + b
y$backward()
x$grad
#> torch_tensor
#>  2
#> [ CPUFloatType{1} ]
w$grad
#> torch_tensor
#>  1
#> [ CPUFloatType{1} ]
b$grad
#> torch_tensor
#>  1
#> [ CPUFloatType{1} ]

Contributing

No matter your current skills it’s possible to contribute to torch development. See the contributing guide for more information.

Copy Link

Version

Install

install.packages('torch')

Monthly Downloads

9,821

Version

0.14.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Daniel Falbel

Last Published

February 14th, 2025

Functions in torch (0.14.2)

AutogradContext

Class representing the context.
Distribution

Generic R6 class representing distributions
backends_cudnn_is_available

CuDNN is available
autograd_backward

Computes the sum of gradients of given tensors w.r.t. graph leaves.
as_array

Converts to array
autograd_set_grad_mode

Set grad mode
autograd_grad

Computes and returns the sum of gradients of outputs w.r.t. the inputs.
Constraint

Abstract base class for constraints.
autograd_function

Records operation history and defines formulas for differentiating ops.
OptimizerIgnite

Abstract Base Class for LibTorch Optimizers
backends_cudnn_version

CuDNN version
call_torch_function

Call a (Potentially Unexported) Torch Function
backends_openmp_is_available

OpenMP is available
contrib_sort_vertices

Contrib sort vertices
backends_mkl_is_available

MKL is available
backends_mkldnn_is_available

MKLDNN is available
clone_module

Clone a torch module.
cuda_is_available

Returns a bool indicating if CUDA is currently available.
backends_mps_is_available

MPS is available
cuda_amp_grad_scaler

Creates a gradient scaler
cuda_empty_cache

Empty cache
cuda_device_count

Returns the number of GPUs available.
dataset

Helper function to create an function that generates R6 instances of class dataset
dataloader_next

Get the next element of a dataloader iterator
broadcast_all

Given a list of values (possibly containing numbers), returns a list where each value is broadcasted based on the following rules:
distr_mixture_same_family

Mixture of components in the same family
cuda_current_device

Returns the index of a currently selected device.
cuda_get_device_capability

Returns the major and minor CUDA capability of device
distr_multivariate_normal

Gaussian distribution
cuda_memory_stats

Returns a dictionary of CUDA memory allocator statistics for a given device.
dataset_subset

Dataset Subset
torch_set_default_dtype

Gets and sets the default floating point dtype.
is_nn_module

Checks if the object is an nn_module
is_nn_parameter

Checks if an object is a nn_parameter
distr_chi2

Creates a Chi2 distribution parameterized by shape parameter df. This is exactly equivalent to distr_gamma(alpha=0.5*df, beta=0.5)
is_undefined_tensor

Checks if a tensor is undefined
install_torch

Install Torch
is_torch_dtype

Check if object is a torch data type
distr_gamma

Creates a Gamma distribution parameterized by shape concentration and rate.
enumerate

Enumerate an iterator
iterable_dataset

Creates an iterable dataset
is_torch_layout

Check if an object is a torch layout.
linalg_cholesky

Computes the Cholesky decomposition of a complex Hermitian or real symmetric positive-definite matrix.
jit_unserialize

Unserialize a Script Module
get_install_libs_url

Install Torch from files
is_torch_memory_format

Check if an object is a memory format
is_torch_qscheme

Checks if an object is a QScheme
jit_save

Saves a script_function to a path
jit_ops

Enable idiomatic access to JIT operators from R.
linalg_eigvalsh

Computes the eigenvalues of a complex Hermitian or real symmetric matrix.
linalg_householder_product

Computes the first n columns of a product of Householder matrices.
cuda_synchronize

Waits for all kernels in all streams on a CUDA device to complete.
cuda_runtime_version

Returns the CUDA runtime version
dataloader_make_iter

Creates an iterator from a DataLoader
dataloader

Data loader. Combines a dataset and a sampler, and provides single- or multi-process iterators over the dataset.
linalg_cholesky_ex

Computes the Cholesky decomposition of a complex Hermitian or real symmetric positive-definite matrix.
distr_bernoulli

Creates a Bernoulli distribution parameterized by probs or logits (but not both). Samples are binary (0 or 1). They take the value 1 with probability p and 0 with probability 1 - p.
linalg_inv

Computes the inverse of a square matrix if it exists.
linalg_inv_ex

Computes the inverse of a square matrix if it is invertible.
linalg_slogdet

Computes the sign and natural logarithm of the absolute value of the determinant of a square matrix.
enumerate.dataloader

Enumerate an iterator
jit_scalar

Adds the 'jit_scalar' class to the input
jit_save_for_mobile

Saves a script_function or script_module in bytecode form, to be loaded on a mobile device
distr_normal

Creates a normal (also called Gaussian) distribution parameterized by loc and scale.
linalg_pinv

Computes the pseudoinverse (Moore-Penrose inverse) of a matrix.
linalg_solve

Computes the solution of a square system of linear equations with a unique solution.
linalg_eigh

Computes the eigenvalue decomposition of a complex Hermitian or real symmetric matrix.
distr_categorical

Creates a categorical distribution parameterized by either probs or logits (but not both).
is_nn_buffer

Checks if the object is a nn_buffer
is_optimizer

Checks if the object is a torch optimizer
is_dataloader

Checks if the object is a dataloader
is_torch_device

Checks if object is a device
linalg_eigvals

Computes the eigenvalues of a square matrix.
linalg_matrix_power

Computes the n-th power of a square matrix for an integer n.
linalg_solve_triangular

Triangular solve
local_autocast

Autocast context manager
load_state_dict

Load a state dict file
linalg_cond

Computes the condition number of a matrix with respect to a matrix norm.
lr_step

Step learning rate decay
lr_scheduler

Creates learning rate schedulers
linalg_svd

Computes the singular value decomposition (SVD) of a matrix.
linalg_qr

Computes the QR decomposition of a matrix.
lr_one_cycle

Once cycle learning rate
jit_trace_module

Trace a module
distr_poisson

Creates a Poisson distribution parameterized by rate, the rate parameter.
jit_tuple

Adds the 'jit_tuple' class to the input
linalg_multi_dot

Efficiently multiplies two or more matrices
lr_reduce_on_plateau

Reduce learning rate on plateau
nn_adaptive_max_pool3d

Applies a 3D adaptive max pooling over an input signal composed of several input planes.
nn_avg_pool2d

Applies a 2D average pooling over an input signal composed of several input planes.
jit_compile

Compile TorchScript code into a graph
jit_serialize

Serialize a Script Module
jit_load

Loads a script_function or script_module previously saved with jit_save
nn_avg_pool3d

Applies a 3D average pooling over an input signal composed of several input planes.
linalg_matrix_rank

Computes the numerical rank of a matrix.
lr_cosine_annealing

Set the learning rate of each parameter group using a cosine annealing schedule
nn_adaptive_avg_pool3d

Applies a 3D adaptive average pooling over an input signal composed of several input planes.
nn_adaptive_log_softmax_with_loss

AdaptiveLogSoftmaxWithLoss module
local_device

Device contexts
nn_batch_norm1d

BatchNorm1D module
nn_batch_norm2d

BatchNorm2D
jit_trace

Trace a function and return an executable script_function.
linalg_eig

Computes the eigenvalue decomposition of a square matrix if it exists.
linalg_det

Computes the determinant of a square matrix.
linalg_lstsq

Computes a solution to the least squares problem of a system of linear equations.
lr_lambda

Sets the learning rate of each parameter group to the initial lr times a given function. When last_epoch=-1, sets initial lr as lr.
lr_multiplicative

Multiply the learning rate of each parameter group by the factor given in the specified function. When last_epoch=-1, sets initial lr as lr.
nn_celu

CELU module
nn_buffer

Creates a nn_buffer
linalg_tensorinv

Computes the multiplicative inverse of torch_tensordot()
linalg_matrix_norm

Computes a matrix norm.
linalg_svdvals

Computes the singular values of a matrix.
linalg_norm

Computes a vector or matrix norm.
nn_avg_pool1d

Applies a 1D average pooling over an input signal composed of several input planes.
nn_adaptive_max_pool1d

Applies a 1D adaptive max pooling over an input signal composed of several input planes.
nn_conv2d

Conv2D module
nn_adaptive_max_pool2d

Applies a 2D adaptive max pooling over an input signal composed of several input planes.
nn_conv3d

Conv3D module
nn_dropout

Dropout module
nn_embedding_bag

Embedding bag module
nn_embedding

Embedding module
linalg_tensorsolve

Computes the solution X to the system torch_tensordot(A, X) = B.
nn_conv_transpose1d

ConvTranspose1D
nn_conv_transpose2d

ConvTranpose2D module
nn_adaptive_avg_pool2d

Applies a 2D adaptive average pooling over an input signal composed of several input planes.
linalg_vector_norm

Computes a vector norm.
nn_adaptive_avg_pool1d

Applies a 1D adaptive average pooling over an input signal composed of several input planes.
nn_gru

Applies a multi-layer gated recurrent unit (GRU) RNN to an input sequence.
nn_ctc_loss

The Connectionist Temporal Classification loss.
nn_cross_entropy_loss

CrossEntropyLoss module
nn_gelu

GELU module
nn_fractional_max_pool3d

Applies a 3D fractional max pooling over an input signal composed of several input planes.
nn_hardshrink

Hardshwink module
nn_identity

Identity module
nn_glu

GLU module
nn_init_dirac_

Dirac initialization
nn_init_constant_

Constant initialization
nn_group_norm

Group normalization
nn_init_calculate_gain

Calculate gain
nn_dropout2d

Dropout2D module
nn_init_eye_

Eye initialization
nn_fractional_max_pool2d

Applies a 2D fractional max pooling over an input signal composed of several input planes.
nn_flatten

Flattens a contiguous range of dims into a tensor.
nn_init_xavier_uniform_

Xavier uniform initialization
nn_init_zeros_

Zeros initialization
nn_bce_with_logits_loss

BCE with logits loss
nn_init_kaiming_normal_

Kaiming normal initialization
nn_init_uniform_

Uniform initialization
nn_init_xavier_normal_

Xavier normal initialization
nn_layer_norm

Layer normalization
nn_batch_norm3d

BatchNorm3D
nn_log_sigmoid

LogSigmoid module
nn_linear

Linear module
nn_kl_div_loss

Kullback-Leibler divergence loss
nn_log_softmax

LogSoftmax module
nn_l1_loss

L1 loss
nn_leaky_relu

LeakyReLU module
nn_lp_pool1d

Applies a 1D power-average pooling over an input signal composed of several input planes.
nn_mse_loss

MSE loss
nn_multi_margin_loss

Multi margin loss
nn_bilinear

Bilinear module
nn_conv_transpose3d

ConvTranpose3D module
nn_cosine_embedding_loss

Cosine embedding loss
nn_hardsigmoid

Hardsigmoid module
nn_hardswish

Hardswish module
nn_contrib_sparsemax

Sparsemax activation
nn_bce_loss

Binary cross entropy loss
nn_hardtanh

Hardtanh module
nn_max_unpool3d

Computes a partial inverse of MaxPool3d.
nn_conv1d

Conv1D module
nn_hinge_embedding_loss

Hinge embedding loss
nn_poisson_nll_loss

Poisson NLL loss
nn_max_unpool2d

Computes a partial inverse of MaxPool2d.
nn_max_unpool1d

Computes a partial inverse of MaxPool1d.
nn_silu

Applies the Sigmoid Linear Unit (SiLU) function, element-wise. The SiLU function is also known as the swish function.
nn_module

Base class for all neural network modules.
nn_prelu

PReLU module
nn_smooth_l1_loss

Smooth L1 loss
nn_multilabel_soft_margin_loss

Multi label soft margin loss
nn_nll_loss

Nll loss
nn_init_ones_

Ones initialization
nn_threshold

Threshold module
nn_tanhshrink

Tanhshrink module
nn_prune_head

Prune top layer(s) of a network
nn_multilabel_margin_loss

Multilabel margin loss
nn_softsign

Softsign module
nn_sequential

A sequential container
nn_multihead_attention

MultiHead attention
nn_triplet_margin_loss

Triplet margin loss
nn_triplet_margin_with_distance_loss

Triplet margin with distance loss
nn_sigmoid

Sigmoid module
nn_rrelu

RReLU module
nn_dropout3d

Dropout3D module
nn_tanh

Tanh module
nn_selu

SELU module
nn_relu

ReLU module
nn_utils_rnn_pack_sequence

Packs a list of variable length Tensors
nn_utils_rnn_pack_padded_sequence

Packs a Tensor containing padded sequences of variable length.
nn_elu

ELU module
nnf_adaptive_avg_pool1d

Adaptive_avg_pool1d
nn_utils_weight_norm

nn_utils_weight_norm
nn_init_kaiming_uniform_

Kaiming uniform initialization
nnf_adaptive_avg_pool3d

Adaptive_avg_pool3d
nnf_adaptive_avg_pool2d

Adaptive_avg_pool2d
nn_utils_rnn_pad_packed_sequence

Pads a packed batch of variable length sequences.
nnf_avg_pool3d

Avg_pool3d
nn_unflatten

Unflattens a tensor dim expanding it to a desired shape. For use with [nn_sequential.
nnf_avg_pool2d

Avg_pool2d
nnf_binary_cross_entropy_with_logits

Binary_cross_entropy_with_logits
nnf_binary_cross_entropy

Binary_cross_entropy
nnf_conv2d

Conv2d
nnf_conv1d

Conv1d
nn_upsample

Upsample module
nn_init_orthogonal_

Orthogonal initialization
nnf_conv_transpose1d

Conv_transpose1d
nnf_dropout3d

Dropout3d
nnf_dropout2d

Dropout2d
nnf_batch_norm

Batch_norm
nnf_bilinear

Bilinear
nn_init_normal_

Normal initialization
nn_init_sparse_

Sparse initialization
nnf_conv_transpose2d

Conv_transpose2d
nn_utils_rnn_pad_sequence

Pad a list of variable length Tensors with padding_value
nnf_alpha_dropout

Alpha_dropout
nn_init_trunc_normal_

Truncated normal initialization
nn_lstm

Applies a multi-layer long short-term memory (LSTM) RNN to an input sequence.
nn_lp_pool2d

Applies a 2D power-average pooling over an input signal composed of several input planes.
nn_margin_ranking_loss

Margin ranking loss
nnf_celu

Celu
nnf_avg_pool1d

Avg_pool1d
nnf_fractional_max_pool3d

Fractional_max_pool3d
nnf_contrib_sparsemax

Sparsemax
nnf_kl_div

Kl_div
nn_max_pool2d

MaxPool2D module
nnf_cosine_embedding_loss

Cosine_embedding_loss
nnf_instance_norm

Instance_norm
nn_max_pool1d

MaxPool1D module
nn_module_list

Holds submodules in a list.
nnf_conv_transpose3d

Conv_transpose3d
nn_module_dict

Container that allows named values
nnf_fractional_max_pool2d

Fractional_max_pool2d
nnf_l1_loss

L1_loss
nnf_lp_pool1d

Lp_pool1d
nnf_embedding

Embedding
nnf_linear

Linear
nnf_elu

Elu
nnf_interpolate

Interpolate
nnf_local_response_norm

Local_response_norm
nn_pairwise_distance

Pairwise distance
nn_max_pool3d

Applies a 3D max pooling over an input signal composed of several input planes.
nn_soft_margin_loss

Soft margin loss
nn_parameter

Creates an nn_parameter
nnf_grid_sample

Grid_sample
nnf_lp_pool2d

Lp_pool2d
nnf_max_pool2d

Max_pool2d
nnf_max_pool3d

Max_pool3d
nn_rnn

RNN module
nn_relu6

ReLu6 module
nn_softmax2d

Softmax2d module
nn_softmin

Softmin
nnf_multi_head_attention_forward

Multi head attention forward
nnf_group_norm

Group_norm
nnf_multilabel_margin_loss

Multilabel_margin_loss
nnf_hardswish

Hardswish
nnf_hardsigmoid

Hardsigmoid
nnf_margin_ranking_loss

Margin_ranking_loss
nnf_max_pool1d

Max_pool1d
nnf_pixel_shuffle

Pixel_shuffle
nnf_multi_margin_loss

Multi_margin_loss
nn_utils_clip_grad_norm_

Clips gradient norm of an iterable of parameters.
nnf_poisson_nll_loss

Poisson_nll_loss
nnf_selu

Selu
nn_softmax

Softmax module
nnf_sigmoid

Sigmoid
nnf_nll_loss

Nll_loss
nnf_normalize

Normalize
nnf_multilabel_soft_margin_loss

Multilabel_soft_margin_loss
nnf_soft_margin_loss

Soft_margin_loss
nnf_softmax

Softmax
nnf_adaptive_max_pool3d

Adaptive_max_pool3d
nnf_affine_grid

Affine_grid
nn_utils_clip_grad_value_

Clips gradient of an iterable of parameters at specified value.
nnf_prelu

Prelu
nnf_relu

Relu
nnf_cross_entropy

Cross_entropy
nnf_conv3d

Conv3d
nnf_gelu

Gelu
nnf_glu

Glu
nnf_hardshrink

Hardshrink
nnf_gumbel_softmax

Gumbel_softmax
nnf_conv_tbc

Conv_tbc
nnf_cosine_similarity

Cosine_similarity
nnf_softshrink

Softshrink
nnf_softsign

Softsign
nnf_relu6

Relu6
nnf_rrelu

Rrelu
nn_softplus

Softplus module
optim_required

Dummy value indicating a required value.
optim_rmsprop

RMSprop optimizer
nnf_silu

Applies the Sigmoid Linear Unit (SiLU) function, element-wise. See nn_silu() for more information.
nnf_layer_norm

Layer_norm
torch_acos

Acos
torch_acosh

Acosh
nnf_one_hot

One_hot
nnf_softmin

Softmin
nnf_max_unpool2d

Max_unpool2d
nnf_leaky_relu

Leaky_relu
nnf_max_unpool1d

Max_unpool1d
nnf_pad

Pad
nn_softshrink

Softshrink module
nnf_softplus

Softplus
optim_adagrad

Adagrad optimizer
%>%

Pipe operator
nnf_unfold

Unfold
optim_adadelta

Adadelta optimizer
optim_adam

Implements Adam algorithm.
optim_ignite_adam

LibTorch implementation of Adam
optim_ignite_adagrad

LibTorch implementation of Adagrad
reexports

Re-exporting the as_iterator function.
nnf_adaptive_max_pool1d

Adaptive_max_pool1d
torch_adaptive_avg_pool1d

Adaptive_avg_pool1d
torch_arccosh

Arccosh
torch_arcsin

Arcsin
torch_atan

Atan
torch_asinh

Asinh
optimizer

Creates a custom optimizer
optimizer_ignite

Abstract Base Class for LibTorch Optimizers
optim_adamw

Implements AdamW algorithm
optim_asgd

Averaged Stochastic Gradient Descent optimizer
optim_lbfgs

LBFGS optimizer
optim_sgd

SGD optimizer
optim_rprop

Implements the resilient backpropagation algorithm.
optim_ignite_sgd

LibTorch implementation of SGD
torch_abs

Abs
torch_add

Add
nnf_adaptive_max_pool2d

Adaptive_max_pool2d
torch_addbmm

Addbmm
torch_addcdiv

Addcdiv
torch_absolute

Absolute
torch_allclose

Allclose
nnf_ctc_loss

Ctc_loss
nnf_dropout

Dropout
torch_arcsinh

Arcsinh
torch_addr

Addr
torch_addmv

Addmv
torch_as_strided

As_strided
torch_arccos

Arccos
torch_chain_matmul

Chain_matmul
torch_arange

Arange
torch_asin

Asin
torch_amax

Amax
nnf_embedding_bag

Embedding_bag
torch_channel_shuffle

Channel_shuffle
nnf_smooth_l1_loss

Smooth_l1_loss
torch_bartlett_window

Bartlett_window
torch_baddbmm

Baddbmm
torch_arctan

Arctan
torch_bernoulli

Bernoulli
torch_cdist

Cdist
torch_broadcast_tensors

Broadcast_tensors
torch_atan2

Atan2
torch_bitwise_or

Bitwise_or
torch_atanh

Atanh
torch_bmm

Bmm
torch_bincount

Bincount
torch_clamp

Clamp
torch_celu

Celu
torch_complex

Complex
torch_bucketize

Bucketize
torch_can_cast

Can_cast
torch_celu_

Celu_
nnf_threshold

Threshold
nnf_tanhshrink

Tanhshrink
tensor_dataset

Dataset wrapping tensors.
nnf_fold

Fold
torch_conj

Conj
threads

Number of threads
torch_addmm

Addmm
torch_addcmul

Addcmul
torch_atleast_1d

Atleast_1d
torch_argmin

Argmin
torch_divide

Divide
torch_dot

Dot
torch_argsort

Argsort
torch_cummax

Cummax
torch_cummin

Cummin
torch_bitwise_xor

Bitwise_xor
torch_conv_transpose1d

Conv_transpose1d
torch_clip

Clip
torch_count_nonzero

Count_nonzero
torch_conv_transpose2d

Conv_transpose2d
torch_atleast_2d

Atleast_2d
torch_equal

Equal
torch_fft_fft

Fft
torch_cartesian_prod

Cartesian_prod
torch_bitwise_and

Bitwise_and
torch_bitwise_not

Bitwise_not
torch_deg2rad

Deg2rad
torch_flipud

Flipud
torch_floor

Floor
torch_fft_fftfreq

fftfreq
torch_greater

Greater
torch_greater_equal

Greater_equal
torch_ceil

Ceil
torch_cholesky_solve

Cholesky_solve
nnf_hardtanh

Hardtanh
torch_dist

Dist
torch_erf

Erf
torch_dequantize

Dequantize
torch_chunk

Chunk
nnf_hinge_embedding_loss

Hinge_embedding_loss
torch_cumsum

Cumsum
torch_cumprod

Cumprod
torch_cross

Cross
torch_diagflat

Diagflat
torch_hypot

Hypot
torch_conv3d

Conv3d
torch_combinations

Combinations
torch_diff

Computes the n-th forward difference along the given dimension.
torch_cat

Cat
torch_clone

Clone
torch_conv_tbc

Conv_tbc
torch_cosine_similarity

Cosine_similarity
torch_cosh

Cosh
torch_diagonal

Diagonal
torch_digamma

Digamma
torch_empty_strided

Empty_strided
torch_index_put_

In-place version of torch_index_put.
torch_empty

Empty
torch_expm1

Expm1
torch_empty_like

Empty_like
torch_eq

Eq
nnf_log_softmax

Log_softmax
nnf_logsigmoid

Logsigmoid
nnf_max_unpool3d

Max_unpool3d
torch_fft_rfft

Rfft
nnf_mse_loss

Mse_loss
nnf_pairwise_distance

Pairwise_distance
nnf_triplet_margin_loss

Triplet_margin_loss
nnf_pdist

Pdist
nnf_triplet_margin_with_distance_loss

Triplet margin with distance loss
optim_ignite_adamw

LibTorch implementation of AdamW
torch_eye

Eye
torch_fft_ifft

Ifft
torch_generator

Create a Generator object
torch_finfo

Floating point type info
torch_fix

Fix
torch_flatten

Flatten
slc

Creates a slice
sampler

Creates a new Sampler
torch_amin

Amin
optim_ignite_rmsprop

LibTorch implementation of RMSprop
torch_isclose

Isclose
torch_diag

Diag
torch_get_rng_state

RNG state management
torch_full_like

Full_like
torch_logsumexp

Logsumexp
torch_eig

Eig
torch_logit

Logit
torch_fmod

Fmod
torch_ger

Ger
torch_i0

I0
torch_floor_divide

Floor_divide
torch_isreal

Isreal
torch_div

Div
torch_fft_irfft

Irfft
torch_einsum

Einsum
torch_diag_embed

Diag_embed
torch_flip

Flip
torch_histc

Histc
torch_fliplr

Fliplr
torch_hstack

Hstack
torch_logdet

Logdet
torch_linspace

Linspace
torch_angle

Angle
torch_index

Index torch tensors
torch_full

Full
torch_index_put

Modify values selected by indices.
torch_isfinite

Isfinite
torch_index_select

Index_select
torch_isinf

Isinf
torch_arctanh

Arctanh
torch_argmax

Argmax
torch_logcumsumexp

Logcumsumexp
torch_load

Loads a saved object
torch_negative

Negative
torch_block_diag

Block_diag
torch_atleast_3d

Atleast_3d
torch_frac

Frac
torch_is_installed

Verifies if torch is installed
torch_blackman_window

Blackman_window
torch_cholesky

Cholesky
torch_avg_pool1d

Avg_pool1d
torch_manual_seed

Sets the seed for generating random numbers.
torch_lt

Lt
torch_isnan

Isnan
torch_matmul

Matmul
torch_is_nonzero

Is_nonzero
torch_less_equal

Less_equal
torch_istft

Istft
torch_logaddexp2

Logaddexp2
torch_gather

Gather
torch_kthvalue

Kthvalue
torch_pixel_shuffle

Pixel_shuffle
torch_lgamma

Lgamma
torch_logical_and

Logical_and
torch_lu

LU
torch_geqrf

Geqrf
torch_log10

Log10
torch_mm

Mm
torch_log

Log
torch_nansum

Nansum
torch_iinfo

Integer type info
torch_max

Max
torch_lstsq

Lstsq
torch_imag

Imag
torch_lerp

Lerp
torch_isneginf

Isneginf
torch_isposinf

Isposinf
torch_cholesky_inverse

Cholesky_inverse
torch_maximum

Maximum
torch_mode

Mode
torch_ormqr

Ormqr
torch_meshgrid

Meshgrid
torch_neg

Neg
torch_masked_select

Masked_select
torch_memory_format

Memory format
torch_conv2d

Conv2d
torch_conv1d

Conv1d
torch_conv_transpose3d

Conv_transpose3d
torch_hann_window

Hann_window
torch_ones_like

Ones_like
torch_cos

Cos
torch_stack

Stack
torch_logspace

Logspace
torch_normal

Normal
torch_norm

Norm
torch_nanquantile

Nanquantile
torch_ones

Ones
torch_less

Less
torch_rand_like

Rand_like
torch_qscheme

Creates the corresponding Scheme object
torch_quantile

Quantile
torch_selu_

Selu_
torch_matrix_rank

Matrix_rank
torch_outer

Outer
torch_logical_or

Logical_or
torch_logical_not

Logical_not
torch_det

Det
torch_heaviside

Heaviside
torch_reshape

Reshape
torch_randint

Randint
torch_repeat_interleave

Repeat_interleave
torch_serialize

Serialize a torch object returning a raw object
torch_searchsorted

Searchsorted
torch_dtype

Torch data types
torch_device

Create a Device object
torch_dstack

Dstack
torch_mul

Mul
torch_matrix_exp

Matrix_exp
torch_orgqr

Orgqr
torch_threshold_

Threshold_
torch_movedim

Movedim
torch_min

Min
torch_logical_xor

Logical_xor
torch_selu

Selu
torch_tan

Tan
torch_poisson

Poisson
torch_sign

Sign
torch_erfc

Erfc
torch_erfinv

Erfinv
torch_randint_like

Randint_like
torch_randn

Randn
torch_sinh

Sinh
with_detect_anomaly

Context-manager that enable anomaly detection for the autograd engine.
torch_sin

Sin
torch_take

Take
torch_tril_indices

Tril_indices
torch_take_along_dim

Selects values from input at the 1-dimensional indices from indices along the given dim.
torch_triu

Triu
with_enable_grad

Enable grad
torch_stft

Stft
torch_sub

Sub
torch_tanh

Tanh
torch_save

Saves an object to a disk file.
torch_topk

Topk
torch_unsafe_split

Unsafe_split
torch_pow

Pow
torch_rad2deg

Rad2deg
torch_trace

Trace
torch_trunc

Trunc
torch_unbind

Unbind
torch_matrix_power

Matrix_power
torch_roll

Roll
torch_minimum

Minimum
torch_is_complex

Is_complex
with_no_grad

Temporarily modify gradient recording.
torch_logaddexp

Logaddexp
torch_exp

Exp
torch_gcd

Gcd
torch_nextafter

Nextafter
torch_nonzero

Nonzero
torch_unsqueeze

Unsqueeze
torch_narrow

Narrow
torch_mean

Mean
torch_exp2

Exp2
torch_randn_like

Randn_like
torch_is_floating_point

Is_floating_point
torch_ge

Ge
torch_std_mean

Std_mean
torch_t

T
torch_randperm

Randperm
torch_sgn

Sgn
torch_not_equal

Not_equal
torch_prod

Prod
torch_triangular_solve

Triangular_solve
torch_result_type

Result_type
torch_real

Real
torch_range

Range
torch_reciprocal

Reciprocal
torch_promote_types

Promote_types
torch_vander

Vander
torch_view_as_real

View_as_real
torch_gt

Gt
torch_hamming_window

Hamming_window
torch_std

Std
torch_polar

Polar
torch_install_path

A simple exported version of install_path Returns the torch installation path.
torch_sigmoid

Sigmoid
torch_unique_consecutive

Unique_consecutive
torch_squeeze

Squeeze
torch_svd

Svd
torch_triu_indices

Triu_indices
torch_reduction

Creates the reduction objet
torch_tril

Tril
torch_view_as_complex

View_as_complex
torch_true_divide

TRUE_divide
torch_layout

Creates the corresponding layout
torch_lu_solve

Lu_solve
torch_inverse

Inverse
torch_lu_unpack

Lu_unpack
torch_multiply

Multiply
torch_log1p

Log1p
torch_slogdet

Slogdet
torch_subtract

Subtract
torch_scalar_tensor

Scalar tensor
torch_multinomial

Multinomial
torch_remainder

Remainder
torch_quantize_per_channel

Quantize_per_channel
torch_kron

Kronecker product
torch_le

Le
torch_lcm

Lcm
torch_log2

Log2
torch_mv

Mv
torch_kaiser_window

Kaiser_window
torch_median

Median
torch_ne

Ne
torch_sum

Sum
torch_signbit

Signbit
torch_pinverse

Pinverse
torch_sort

Sort
torch_pdist

Pdist
torch_qr

Qr
torch_relu_

Relu_
torch_unsafe_chunk

Unsafe_chunk
torch_relu

Relu
torch_quantize_per_tensor

Quantize_per_tensor
torch_polygamma

Polygamma
torch_var

Var
torch_rsqrt

Rsqrt
torch_renorm

Renorm
torch_rand

Rand
torch_mvlgamma

Mvlgamma
torch_rrelu_

Rrelu_
torch_tensordot

Tensordot
torch_trapz

Trapz
torch_sparse_coo_tensor

Sparse_coo_tensor
torch_var_mean

Var_mean
torch_vdot

Vdot
torch_round

Round
torch_split

Split
torch_transpose

Transpose
torch_zeros_like

Zeros_like
torch_tensor

Converts R objects to a torch tensor
torch_rot90

Rot90
torch_tensor_from_buffer

Creates a tensor from a buffer of memory
torch_zeros

Zeros
torch_square

Square
torch_where

Where
torch_sqrt

Sqrt
torch_vstack

Vstack