Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

torch_true_divide

TRUE_divide


Description

TRUE_divide

Usage

torch_true_divide(self, other)

Arguments

self

(Tensor) the dividend

other

(Tensor or Scalar) the divisor

true_divide(dividend, divisor) -> Tensor

Performs "true division" that always computes the division in floating point. Analogous to division in Python 3 and equivalent to torch_div except when both inputs have bool or integer scalar types, in which case they are cast to the default (floating) scalar type before the division.

\mbox{out}_i = \frac{\mbox{dividend}_i}{\mbox{divisor}}

Examples

if (torch_is_installed()) {

dividend = torch_tensor(c(5, 3), dtype=torch_int())
divisor = torch_tensor(c(3, 2), dtype=torch_int())
torch_true_divide(dividend, divisor)
torch_true_divide(dividend, 2)
}

torch

Tensors and Neural Networks with 'GPU' Acceleration

v0.3.0
MIT + file LICENSE
Authors
Daniel Falbel [aut, cre, cph], Javier Luraschi [aut], Dmitriy Selivanov [ctb], Athos Damiani [ctb], Christophe Regouby [ctb], Krzysztof Joachimiak [ctb], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.