Learn R Programming

rTorch (version 0.4.2)

logical_not: Logical NOT of a tensor

Description

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

Usage

# S3 method for torch.Tensor
!(x)

Arguments

x

tensor

Value

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

Examples

Run this code
# NOT RUN {
A <- torch$ones(5L)
!A

Z <- torch$zeros(5L)
!Z
# }

Run the code above in your browser using DataLab