Learn R Programming

torch (version 0.0.2)

torch_logical_not: Logical_not

Description

Logical_not

Arguments

input

(Tensor) the input tensor.

out

(Tensor, optional) the output tensor.

logical_not(input, out=None) -> Tensor

Computes the element-wise logical NOT of the given input tensor. If not specified, the output tensor will have the bool dtype. If the input tensor is not a bool tensor, zeros are treated as False and non-zeros are treated as True.

Examples

Run this code
# NOT RUN {
if (torch_is_installed()) {

torch_logical_not(torch_tensor(c(TRUE, FALSE)))
torch_logical_not(torch_tensor(c(0, 1, -10), dtype=torch_int8()))
torch_logical_not(torch_tensor(c(0., 1.5, -10.), dtype=torch_double()))
}
# }

Run the code above in your browser using DataLab