jax.numpy.atleast_1d

Contents

jax.numpy.atleast_1d#

jax.numpy.atleast_1d() list[Array][source]#
jax.numpy.atleast_1d(x: ArrayLike, /) Array
jax.numpy.atleast_1d(x: ArrayLike, y: ArrayLike, /, *arys: ArrayLike) list[Array]

Convert inputs to arrays with at least one dimension.

LAX-backend implementation of numpy.atleast_1d().

The JAX version of this function may in some cases return a copy rather than a view of the input.

Original docstring below.

Scalar inputs are converted to 1-dimensional arrays, whilst higher-dimensional inputs are preserved.

Parameters:
  • arys1 (array_like) – One or more input arrays.

  • arys2 (array_like) – One or more input arrays.

  • ... (array_like) – One or more input arrays.

Returns:

ret – An array, or tuple of arrays, each with a.ndim >= 1. Copies are made only if necessary.

Return type:

ndarray