%%.torch.Tensor {rTorch}R Documentation

Remainder

Description

Computes the element-wise remainder of division.

Usage

## S3 method for class 'torch.Tensor'
a %% b

Arguments

a

a tensor

b

a scalar or a tensor

Value

the reminder of the division between tensor by a scalar or tensor

Examples

## Not run: 
x <- torch$Tensor(list(-3., -2, -1, 1, 2, 3))
y <- torch$Tensor(list(1., 2, 3, 4, 5))
torch$remainder(x, 2)
torch$remainder(y, 1.5)

x %% 2
y %% 1.5

## End(Not run)

[Package rTorch version 0.4.2 Index]