validate_axis#

caf.distribute.array_utils.validate_axis(axis, n_dims, name='axis')#

Validate axis values against a number of dimensions.

Parameters:
  • axis (Collection[int]) – The axis values to validate

  • n_dims (int) – The number of dimensions in the matrix that axis should be validated against

  • name (str) – The name to write out in the error message, if generated

Return type:

None

Raises:

ValueError: – If any axis values are negative, duplicated, or too high.