jax.numpy.iterable

jax.numpy.iterable(y)

Check whether or not an object can be iterated over.

Parameters

y (object) – Input object.

Returns

b – Return True if the object has an iterator method or is a sequence and False otherwise.

Return type

bool

Examples

>>> np.iterable([1, 2, 3])
True
>>> np.iterable(2)
False