equals-.torch.Tensor: Compares two tensors if equal

Description Usage Arguments Value Examples

Description

This generic is approximately similar to torch$eq(a, b), with the difference that the generic returns a tensor of booleans instead of a tensor of data type torch$uint8.

Usage

1
2
## S3 method for class 'torch.Tensor'
x == y

Arguments

x

tensor

y

tensor

Value

A tensor of booleans, where False corresponds to 0, and 1 to True in a tensor of data type torch$bool.

Examples

1
2
3
4
5
6
## Not run: 
a <- torch$Tensor(list(1, 1, 1))
b <- torch$Tensor(list(2, 2, 2))
a == b

## End(Not run)

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