log.torch.Tensor: Logarithm of a tensor given the tensor and the base

Description Usage Arguments Examples

Description

Logarithm of a tensor given the tensor and the base

Usage

1
2
## S3 method for class 'torch.Tensor'
log(x, base = exp(1L))

Arguments

x

a tensor

base

the base of the logarithm

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
x <- torch$tensor(c(512, 1024, 2048, 4096))   # tensor([ 9., 10., 11., 12.])
base <- 2
log(x, base)

x <- torch$tensor(c(1, 10, 100, 1000))         # tensor([0., 1., 2., 3.])
log(x, 10)

## End(Not run)

rTorch documentation built on Jan. 13, 2021, 4:32 p.m.