skcuda.misc.sum

skcuda.misc.sum(x_gpu, axis=None, out=None, keepdims=False)[source]

Compute the sum along the specified axis.

Parameters:
  • x_gpu (pycuda.gpuarray.GPUArray) – Array containing numbers whose sum is desired.
  • axis (int (optional)) – Axis along which the sums are computed. The default is to compute the sum of the flattened array.
  • out (pycuda.gpuarray.GPUArray (optional)) – Output array in which to place the result.
  • keepdims (bool (optional, default False)) – If True, the axes which are reduced are left in the result as dimensions with size one.
Returns:

out – sum of elements, or sums of elements along the desired axis.

Return type:

pycuda.gpuarray.GPUArray