View source: R/gen-namespace.R
torch_sub | R Documentation |
Sub
torch_sub(self, other, alpha = 1L)
self |
(Tensor) the input tensor. |
other |
(Tensor or Scalar) the tensor or scalar to subtract from |
alpha |
the scalar multiplier for other |
Subtracts other
, scaled by alpha
, from input
.
\mbox{{out}}_i = \mbox{{input}}_i - \mbox{{alpha}} \times \mbox{{other}}_i
Supports broadcasting to a common shape , type promotion , and integer, float, and complex inputs.
if (torch_is_installed()) {
a <- torch_tensor(c(1, 2))
b <- torch_tensor(c(0, 1))
torch_sub(a, b, alpha=2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.