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

Function validate_axis

dask/array/utils.py:516–528  ·  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("Axis value must be an integer, got %s" % axis)
522 if axis < -ndim or axis >= ndim:
523 raise AxisError(
524 "Axis %d is out of bounds for array of dimension %d" % (axis, ndim)
525 )
526 if axis < 0:
527 axis += ndim
528 return axis
529
530
531def 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