ivy.to_ivy(x: Union[ivy.Array, ivy.NativeArray, Iterable], nested: bool = False) → Union[ivy.Array, ivy.NativeArray, Iterable][source]

Returns the input array converted to an ivy.Array instances if it is an array type, otherwise the input is returned unchanged. If nested is set, the check is applied to all nested leafs of tuples, lists and dicts contained within x.

  • x (any) – The input to maybe convert.

  • nested (bool, optional) – Whether to apply the conversion on arguments in a nested manner. If so, all dicts, lists and tuples will be traversed to their lowest leaves in search of ivy.Array and ivy.Variable instances. Default is False.


the input in it’s native framework form in the case of ivy.Array or ivy.Variable instances.

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty