torch_isinf: Isinf

View source: R/gen-namespace.R

torch_isinfR Documentation

Isinf

Description

Isinf

Usage

torch_isinf(self)

Arguments

self

(Tensor) A tensor to check

TEST

Returns a new tensor with boolean elements representing if each element is ⁠+/-INF⁠ or not.

Examples

if (torch_is_installed()) {

torch_isinf(torch_tensor(c(1, Inf, 2, -Inf, NaN)))
}

torch documentation built on Aug. 21, 2025, 5:50 p.m.