is_dtype

is_dtype = <function is_dtype>

Indicate whether a provided dtype is of a specified data type “kind”.

Parameters:
  • dtype (DType) – The input dtype.

  • kind (str) –

    data type kind. The function must return a boolean indicating whether the input dtype is of a specified data type kind. The following dtype kinds must be supported:

    • ’bool’: boolean data type (Bool).

    • ’signed integer’: signed integer data types (Int8, Int16, Int32, Int64).

    • ’unsigned integer’: unsigned integer data types (UInt8, UInt16, UInt32, UInt64).

    • ’floating’: floating-point data types (Float32, Float64).

    • ’integral’: integer data types. Shorthand for (‘signed integer’, ‘unsigned integer’).

    • ’numeric’: numeric data types. Shorthand for (‘integral’, ‘floating’).

    If kind is a tuple, the tuple specifies a union of dtypes and/or kinds, and the function must return a boolean indicating whether the input dtype is either equal to a specified dtype or belongs to at least one specified data type kind.

Returns:

bool