MCPcopy
hub / github.com/dask/dask / validate_axis

Function validate_axis

dask/array/utils.py:514–524  ·  view source on GitHub ↗

Validate an input to axis= keywords

(axis, ndim)

Source from the content-addressed store, hash-verified

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…