to_ivy(x: Union[ivy.Array, ivy.NativeArray, Iterable], nested: bool = False) → Union[ivy.Array, ivy.NativeArray, Iterable]¶
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.