# mlx.core.array — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.core.array

class mlx.core.array

  An N-dimensional array object.

  __init__(self: array, val: Union[scalar, list , tuple , ndarray , array ], dtype: Optional[ Dtype ] = None)

  Methods

  `__init__`(self, val[, dtype]) |
  `abs`(self, *[, stream]) | See `abs()`.
  `all`(self[, axis, keepdims, stream]) | See `all()`.
  `any`(self[, axis, keepdims, stream]) | See `any()`.
  `argmax`(self[, axis, keepdims, stream]) | See `argmax()`.
  `argmin`(self[, axis, keepdims, stream]) | See `argmin()`.
  `astype`(self, dtype[, stream]) | Cast the array to a specified type.
  `cos`(self, *[, stream]) | See `cos()`.
  `cummax`(self[, axis, reverse, inclusive, stream]) | See `cummax()`.
  `cummin`(self[, axis, reverse, inclusive, stream]) | See `cummin()`.
  `cumprod`(self[, axis, reverse, inclusive, stream]) | See `cumprod()`.
  `cumsum`(self[, axis, reverse, inclusive, stream]) | See `cumsum()`.
  `exp`(self, *[, stream]) | See `exp()`.
  `flatten`(self[, start_axis, end_axis, stream]) | See `flatten()`.
  `item`(self) | Access the value of a scalar array.
  `log`(self, *[, stream]) | See `log()`.
  `log10`(self, *[, stream]) | See `log10()`.
  `log1p`(self, *[, stream]) | See `log1p()`.
  `log2`(self, *[, stream]) | See `log2()`.
  `logsumexp`(self[, axis, keepdims, stream]) | See `logsumexp()`.
  `max`(self[, axis, keepdims, stream]) | See `max()`.
  `mean`(self[, axis, keepdims, stream]) | See `mean()`.
  `min`(self[, axis, keepdims, stream]) | See `min()`.
  `moveaxis`(self, source, destination, *[, stream]) | See `moveaxis()`.
  `prod`(self[, axis, keepdims, stream]) | See `prod()`.
  `reciprocal`(self, *[, stream]) | See `reciprocal()`.
  `reshape`(self, *args[, stream]) | Equivalent to `reshape()` but the shape can be passed either as a tuple or as separate arguments.
  `round`(self, /[, decimals, stream]) | See `round()`.
  `rsqrt`(self, *[, stream]) | See `rsqrt()`.
  `sin`(self, *[, stream]) | See `sin()`.
  `split`(self, indices_or_sections[, axis, stream]) | See `split()`.
  `sqrt`(self, *[, stream]) | See `sqrt()`.
  `square`(self, *[, stream]) | See `square()`.
  `squeeze`(self[, axis, stream]) | See `squeeze()`.
  `sum`(self[, axis, keepdims, stream]) | See `sum()`.
  `swapaxes`(self, axis1, axis2, *[, stream]) | See `moveaxis()`.
  `tolist`(self) | Convert the array to a Python `list`.
  `transpose`(self, *args[, stream]) | Equivalent to `transpose()` but the axes can be passed either as a tuple or as separate arguments.
  `var`(self[, axis, keepdims, ddof, stream]) | See `var()`.

  Attributes

  `T` | Equivalent to calling `self.transpose()` with no arguments.
  `dtype` | The array's `Dtype`.
  `itemsize` | The size of the array's datatype in bytes.
  `nbytes` | The number of bytes in the array.
  `ndim` | The array's dimension.
  `shape` | The shape of the array as a Python list.
  `size` | Number of elements in the array.