xp_copy¶
- xp_copy(x: Any, *, xp: ModuleType | None = None) Any[source][source]¶
Copies an array.
- Parameters:
x (
array)xp (
array_namespace)
- Returns:
copy – Copied array
- Return type:
array
Notes
This copy function does not offer all the semantics of
np.copy, i.e. thesubokandorderkeywords are not used.Examples
>>> import numpy as np >>> xp_copy([1,2,3], xp=np) array([1, 2, 3])