jax.numpy.asarray#
- jax.numpy.asarray(a, dtype=None, order=None)[source]#
Convert the input to an array.
LAX-backend implementation of
numpy.asarray()
.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, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists and ndarrays.
dtype (data-type, optional) β By default, the data-type is inferred from the input data.
order ({'C', 'F', 'A', 'K'}, optional) β Memory layout. βAβ and βKβ depend on the order of input array a. βCβ row-major (C-style), βFβ column-major (Fortran-style) memory representation. βAβ (any) means βFβ if a is Fortran contiguous, βCβ otherwise βKβ (keep) preserve input order Defaults to βKβ.
- Returns:
out β Array interpretation of a. No copy is performed if the input is already an ndarray with matching dtype and order. If a is a subclass of ndarray, a base class ndarray is returned.
- Return type:
ndarray