Learn R Programming

rTorch (version 0.4.2)

-.torch.Tensor: Subtract two tensors

Description

This generic is similar to applying torch$sub(a, b)

Usage

# S3 method for torch.Tensor
-(a, b)

Arguments

a

tensor

b

tensor

Value

Another tensor representing the subtraction of two tensors.

Examples

Run this code
# NOT RUN {
a <- torch$Tensor(list(1, 1, 1))
b <- torch$Tensor(list(2, 2, 2))
s <- 2.0
a - b
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab