torch_frac: Frac

View source: R/gen-namespace.R

torch_fracR Documentation

Frac

Description

Frac

Usage

torch_frac(self)

Arguments

self

the input tensor.

frac(input, out=NULL) -> Tensor

Computes the fractional portion of each element in input.

\mbox{out}_{i} = \mbox{input}_{i} - \left\lfloor |\mbox{input}_{i}| \right\rfloor * \mbox{sgn}(\mbox{input}_{i})

Examples

if (torch_is_installed()) {

torch_frac(torch_tensor(c(1, 2.5, -3.2)))
}

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