copy_nest

ivy.copy_nest(nest: Union[ivy.Array, ivy.NativeArray, Iterable], include_derived: bool = False, to_mutable: bool = False) → Union[ivy.Array, ivy.NativeArray, Iterable][source]

Copies a nest deeply, but without copying leaves of the nest, only the nest lists, tuples and dicts are copied.

Parameters
  • nest (nested) – The nest to copy.

  • include_derived (bool, optional) – Whether to also recursive for classes derived from tuple, list and dict. Default is False.

  • to_mutable (bool, optional) – Whether to convert the nest to a mutable form, changing all tuples to lists. Default is False.

Returns

The copied nest.


Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty