Learn R Programming

rTorch (version 0.4.2)

logical_or: Logical OR of two tensors

Description

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

Usage

# S3 method for 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

Run this code
# 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
# }

Run the code above in your browser using DataLab