Learn R Programming

torch (version 0.0.2)

torch_eq: Eq

Description

Eq

Arguments

input

(Tensor) the tensor to compare

other

(Tensor or float) the tensor or value to compare

out

(Tensor, optional) the output tensor. Must be a ByteTensor

eq(input, other, out=None) -> Tensor

Computes element-wise equality

The second argument can be a number or a tensor whose shape is broadcastable with the first argument.

Examples

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

torch_eq(torch_tensor(c(1,2,3,4)), torch_tensor(c(1, 3, 2, 4)))
}
# }

Run the code above in your browser using DataLab