is_native_array#
- ivy.is_native_array(x, /, *, exclusive=False)[source]#
Determine whether the input x is an
ivy.NativeArray
instance.- Parameters:
x (
Union
[Array
,NativeArray
]) – The input to checkexclusive (
bool
, default:False
) – Whether to check if the input x is exclusively an array, rather than a variable or traced array.
- Return type:
bool
- Returns:
ret – Boolean, whether or not x is an
ivy.NativeArray
.
Examples
>>> x = ivy.array([0, 1, 2]) >>> ivy.is_native_array(x) False
>>> x = ivy.native_array([9.1, -8.3, 2.8, 3.0]) >>> ivy.is_native_array(x, exclusive=True) True
- Array.is_native_array(self, /, *, exclusive=False)[source]#
ivy.Array instance method variant of ivy.is_native_array. This method simply wraps the function, and so the docstring for ivy.is_native_array also applies to this method with minimal changes.
- Parameters:
self (
Array
) – The input to checkexclusive (
bool
, default:False
) – Whether to check if the data type is exclusively an array, rather than a variable or traced array.
- Return type:
Array
- Returns:
ret – Boolean, whether or not x is a native array.
Examples
>>> x = ivy.array([0, 1, 2]) >>> ret = x.is_native_array() >>> print(ret) False
- Container.is_native_array(self, /, *, exclusive=False, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False)[source]#
ivy.Container instance method variant of ivy.is_native_array. This method simply wraps the function, and so the docstring for ivy.ivy.is_native_array also applies to this method with minimal changes.
- Parameters:
self (
Container
) – The input to checkexclusive (
Union
[bool
,Container
], default:False
) – Whether to check if the data type is exclusively an array, rather than a variable or traced array.key_chains (
Optional
[Union
[List
[str
],Dict
[str
,str
],Container
]], default:None
) – The key-chains to apply or not apply the method to. Default isNone
.to_apply (
Union
[bool
,Container
], default:True
) – If True, the method will be applied to key_chains, otherwise key_chains will be skipped. Default isTrue
.prune_unapplied (
Union
[bool
,Container
], default:False
) – Whether to prune key_chains for which the function was not applied. Default isFalse
.map_sequences (
Union
[bool
,Container
], default:False
) – Whether to also map method to sequences (lists, tuples). Default isFalse
.
- Return type:
Container
- Returns:
ret – Boolean, whether or not x is a native array.
Examples
>>> x = ivy.Container(a=ivy.array([1]), b=ivy.native_array([2, 3])) >>> y = x.is_native_array() >>> print(y) { a: False, b: True }