logical_or: Logical OR of two tensors

Description Usage Arguments Value Examples

Description

There is not equivalent function in PyTorch for this generic. To generate this generic we use the function np$logical_or().

Usage

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

Arguments

x

tensor

y

tensor

Value

A tensor of booleans representing the logical result of the comparison. False to represent 0, and True to represent 1 in a tensor of data type torch$uint8.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
A <- torch$BoolTensor(list(0L, 1L))
B <- torch$BoolTensor(list(1L, 0L))
C <- torch$BoolTensor(list(1L, 1L))
A | B
C | A
B | C

## End(Not run)

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