Sub
torch_sub(self, other, alpha = 1L)
self
: (Tensor) the input tensor.other
: (Tensor or Scalar) the tensor or scalar to subtract from input
alpha
: the scalar multiplier for otherSubtracts other
, scaled by alpha
, from input
.
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) }
Useful links
Downloads (last 30 days):