Tensor creation and casting

Functions used to create new tensors and cast them back to R arrays.

tensor()

Creates a torch tensor.

tensor_from_r()

Create torch Tensor from R object

as.array(<tensor>)

Tensor casting

as.matrix(<tensor>)

Casts a 2d tensor to a matrix.

tch_randn()

Random normal

tch_arange()

arange

tch_empty()

Empty tensor

tch_eye()

Eye matrix (identity matrix)

tch_full()

Full tensor (one value filled tensor)

tch_linspace()

Linear spaced tensor

tch_logspace()

Loglinear spaced tensor

tch_ones()

One filled tensor

tch_rand()

Random uniform

tch_randint()

Random discrete uniform

tch_randperm()

Random permutation

tch_zeros()

Zero filled tensor

Autograd

Utility functions related to autograd.

with_no_grad()

With no grad

Tensor methods

Methods for tensors. They are always prefixed with tch_

`-`(<tensor>)

substraction

`==`(<tensor>)

Eq

`+`(<tensor>)

elementwise addition

`^`(<tensor>)

pow

`/`(<tensor>)

Div

`*`(<tensor>)

elementwise multiplciation

tch_log() tch_log2() tch_log10() tch_log1p()

log

tch_abs()

Abs

tch_acos()

Arc-cos

tch_all()

all

tch_allclose()

allclose

tch_any()

any

tch_arange()

arange

tch_argmax()

argmax

tch_argmin()

argmin

tch_as_strided()

as_strided

tch_asin()

asin

tch_atan()

atan

tch_atan2()

atan2

tch_baddbmm()

baddbmm

tch_bernoulli()

bernoulli

tch_bincount()

bincount

tch_bmm()

bmm

tch_btrifact()

Batch LU factorization

tch_btrisolve()

Batch LU solve

tch_ceil()

Ceil

tch_chunk()

Chunk

tch_clamp()

Clamp

tch_clamp_max()

Clamp max

tch_clamp_min()

Clamp min

tch_cos()

Cosine

tch_cosh()

Hyperbolic Cosine

tch_cross()

Cross

tch_cuda_is_available()

Checks if cuda is available.

tch_cumprod()

Cumprod

tch_cumsum()

Cumsum

tch_det()

Determinant

tch_diag()

Diag

tch_diagflat()

Diagflat

tch_diagonal()

Diagonal

tch_digamma()

Digamma

tch_dist()

Distance

tch_dot()

Dot product

tch_eig()

Eigenvalues and Eigenvectors

tch_empty()

Empty tensor

tch_equal()

Equal

tch_eye()

Eye matrix (identity matrix)

tch_full()

Full tensor (one value filled tensor)

tch_gels()

Gels

tch_lerp()

lerp

tch_linspace()

Linear spaced tensor

tch_logspace()

Loglinear spaced tensor

tch_logsumexp()

logsumexp

tch_max()

max

tch_mean()

mean

tch_median()

median

tch_min()

min

tch_mm()

matrix multiplication

tch_mode()

mode

tch_ones()

One filled tensor

tch_permute()

permute

tch_prod()

prod

tch_qr()

QR decomposition

tch_rand()

Random uniform

tch_randint()

Random discrete uniform

tch_randn()

Random normal

tch_randperm()

Random permutation

tch_round()

round

tch_rsqrt()

rsqrt

tch_sigmoid()

sigmoid

tch_sign()

sign

tch_sin()

sin

tch_sinh()

sinh

tch_sqrt()

sqrt

tch_std()

std

tch_sum()

sum

tch_t()

transpose

tch_tan()

tan

tch_tanh()

tanh

tch_tril()

Lower triangle

tch_triu()

Upper triangle

tch_trunc()

trunc

tch_var()

var

tch_zeros()

Zero filled tensor