is_int_dtype#
- ivy.is_int_dtype(dtype_in, /)[source]#
Determine whether the input data type is an int data type.
- Parameters:
dtype_in (
Union
[Dtype
,str
,Array
,NativeArray
,Number
]) – input data type to test.- Return type:
bool
- Returns:
ret – “True” if the input data type is an integer, otherwise “False”.
Both the description and the type hints above assumes an array input for
simplicity but this function is *nestable, and therefore also accepts*
ivy.Container
instances in place of any of the arguments.
Examples
With
ivy.Dtype
input:>>> x = ivy.is_int_dtype(ivy.float64) >>> print(x) False
With
ivy.Array
input:>>> x = ivy.array([1., 2., 3.]) >>> print(ivy.is_int_dtype(x), x.dtype) False float32
With
ivy.NativeArray
input:>>> x = ivy.native_array([[-1, -1, -1], [1, 1, 1]], dtype=ivy.int16) >>> print(ivy.is_int_dtype(x)) True
With
Number
input:>>> x = 1 >>> print(ivy.is_int_dtype(x)) True
With
ivy.Container
input:>>> x = ivy.Container(a=ivy.array([0., 1., 2.]),b=ivy.array([3, 4, 5])) >>> print(ivy.is_int_dtype(x)) { a: False, b: True }