jax.numpy.copy

Contents

jax.numpy.copy#

jax.numpy.copy(a, order=None)[source]#

Return an array copy of the given object.

LAX-backend implementation of numpy.copy().

This function will create arrays on JAX’s default device. For control of the device placement of data, see jax.device_put(). More information is available in the JAX FAQ at Controlling data and computation placement on devices (full FAQ at https://jax.readthedocs.io/en/latest/faq.html).

Original docstring below.

Parameters:
  • a (array_like) – Input data.

  • order ({'C', 'F', 'A', 'K'}, optional) – Controls the memory layout of the copy. ‘C’ means C-order, ‘F’ means F-order, ‘A’ means ‘F’ if a is Fortran contiguous, ‘C’ otherwise. ‘K’ means match the layout of a as closely as possible. (Note that this function and ndarray.copy() are very similar, but have different default values for their order= arguments.)

Returns:

arr – Array interpretation of a.

Return type:

ndarray