logical_or {rTorch}R Documentation

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 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

## 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)

[Package rTorch version 0.4.2 Index]