MCPcopy Create free account
hub / github.com/dask/dask / validate_axis

Function validate_axis

dask/array/utils.py:531–541  ·  view source on GitHub ↗

Validate an input to axis= keywords

(axis, ndim)

Source from the content-addressed store, hash-verified

529
530
531def validate_axis(axis, ndim):
532 """Validate an input to axis= keywords"""
533 if isinstance(axis, (tuple, list)):
534 return tuple(validate_axis(ax, ndim) for ax in axis)
535 if not isinstance(axis, numbers.Integral):
536 raise TypeError(f"Axis value must be an integer, got {axis}")
537 if axis < -ndim or axis >= ndim:
538 raise AxisError(f"Axis {axis} is out of bounds for array of dimension {ndim}")
539 if axis < 0:
540 axis += ndim
541 return axis
542
543
544def svd_flip(u, v, u_based_decision=False):

Callers 15

reductionFunction · 0.90
arg_reductionFunction · 0.90
prefixscan_blellochFunction · 0.90
cumreductionFunction · 0.90
topkFunction · 0.90
argtopkFunction · 0.90
gradientFunction · 0.90
expand_dimsFunction · 0.90
squeezeFunction · 0.90
compressFunction · 0.90
takeFunction · 0.90
insertFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected