library("SpaNorm")
rowSums_gpu(matrix(1:6, 2, 3))[1] 9 12
As rowSums2, but runs on the accelerator when mat is a torch tensor and an accelerator is active.
rowSums_gpu(mat)
mat
|
a matrix or torch tensor. |
a numeric vector (or torch tensor) of row sums.