grapes-grapes-.torch.Tensor: Remainder

Description Usage Arguments Value Examples

Description

Computes the element-wise remainder of division.

Usage

1
2
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)

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