to_native

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

Returns the input item in it’s native backend framework form if it is an ivy.Array or ivy.Variable instance. 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.

Parameters
  • 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.

Returns

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