Skip to contents

As rowSums2, but runs on the accelerator when mat is a torch tensor and an accelerator is active.

Usage

rowSums_gpu(mat)

Arguments

mat

a matrix or torch tensor.

Value

a numeric vector (or torch tensor) of row sums.

Examples

rowSums_gpu(matrix(1:6, 2, 3))
#> [1]  9 12