{ } Raw JSON

bundles / scipy 1.17.1 / scipy / ndimage / _measurements / sum

function

scipy.ndimage._measurements:sum

source: /scipy/ndimage/_measurements.py :701

Signature

def   sum ( input labels = None index = None )

Summary

Calculate the sum of the values of the array.

Notes

This is an alias for ndimage.sum_labels kept for backwards compatibility reasons, for new code please prefer sum_labels. See the sum_labels docstring for more details.

Array API Standard Support

sum has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.

====================  ====================  ====================
Library               CPU                   GPU
====================  ====================  ====================
NumPy                 ✅                     n/a                 
CuPy                  n/a                   ✅                   
PyTorch               ✅                     ⛔                   
JAX                   ⚠️ no JIT
Dask                  ⚠️ computes graph     n/a                 
====================  ====================  ====================

See dev-arrayapi for more information.

Aliases

  • scipy.ndimage.sum