mlx.core.isdtype

Contents

mlx.core.isdtype#

isdtype(dtype: Dtype, kind: Dtype | str | tuple[Dtype | str, ...]) bool#

Test whether a dtype belongs to one or more data type kinds.

Parameters:
  • dtype (Dtype) – The dtype to test.

  • kind (Dtype, str, or tuple) – A dtype, a kind string, or a tuple of dtypes and kind strings. Supported kind strings are "bool", "signed integer", "unsigned integer", "integral", "real floating", "complex floating", and "numeric".

Returns:

True if dtype matches any of the given kinds.

Return type:

bool