torch_maximum: Maximum

View source: R/gen-namespace.R

torch_maximumR Documentation

Maximum

Description

Maximum

Usage

torch_maximum(self, other)

Arguments

self

(Tensor) the input tensor.

other

(Tensor) the second input tensor

maximum(input, other, *, out=None) -> Tensor

Computes the element-wise maximum of input and other.

Note

If one of the elements being compared is a NaN, then that element is returned. torch_maximum() is not supported for tensors with complex dtypes.

Examples

if (torch_is_installed()) {

a <- torch_tensor(c(1, 2, -1))
b <- torch_tensor(c(3, 0, 4))
torch_maximum(a, b)
}

torch documentation built on May 29, 2024, 9:54 a.m.