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

Function validate_axis

dask/array/utils.py:516–526  ·  view source on GitHub ↗

Validate an input to axis= keywords

(axis, ndim)

Source from the content-addressed store, hash-verified

514
515
516def validate_axis(axis, ndim):
517 """Validate an input to axis= keywords"""
518 if isinstance(axis, (tuple, list)):
519 return tuple(validate_axis(ax, ndim) for ax in axis)
520 if not isinstance(axis, numbers.Integral):
521 raise TypeError(f"Axis value must be an integer, got {axis}")
522 if axis < -ndim or axis >= ndim:
523 raise AxisError(f"Axis {axis} is out of bounds for array of dimension {ndim}")
524 if axis < 0:
525 axis += ndim
526 return axis
527
528
529def 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