xp_copy

xp_copy(x: Any, *, xp: ModuleType | None = None) Any[source][source]

Copies an array.

Parameters:
Returns:

copy – Copied array

Return type:

array

Notes

This copy function does not offer all the semantics of np.copy, i.e. the subok and order keywords are not used.

Examples

>>> import numpy as np
>>> xp_copy([1,2,3], xp=np)
array([1, 2, 3])