{ } Raw JSON

bundles / scipy 1.18.0 / scipy / stats / _stats_py / _xp_var

function

scipy.stats._stats_py:_xp_var

source: /scipy/stats/_stats_py.py:11129

Signature

def _xp_var(x, /, axis = None, correction = 0, keepdims = False, nan_policy = propagate, dtype = None, xp = None)

Notes

Array API Standard Support

_xp_var 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                   ✅                     ✅                   
Dask                  ✅                     n/a                 
====================  ====================  ====================

See dev-arrayapi for more information.

Aliases

  • scipy.stats._stats_py._xp_var