mlx.core.array#
- class array#
An N-dimensional array object.
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.
conj(self, *[, stream])See
conj().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().diag(self[, k, stream])Extract a diagonal or construct a diagonal matrix.
diagonal(self[, offset, axis1, axis2, stream])See
diagonal().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().logcumsumexp(self[, axis, reverse, ...])See
logcumsumexp().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, *shape[, stream])Equivalent to
reshape()but the shape can be passed either as atupleor 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().std(self[, axis, keepdims, ddof, stream])See
std().sum(self[, axis, keepdims, stream])See
sum().swapaxes(self, axis1, axis2, *[, stream])See
swapaxes().tolist(self)Convert the array to a Python
list.transpose(self, *axes[, 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().view(self, dtype, *[, stream])See
view().Attributes
Equivalent to calling
self.transpose()with no arguments.Used to apply updates at the given indices.
The array's
Dtype.The imaginary part of a complex array.
The size of the array's datatype in bytes.
The number of bytes in the array.
The array's dimension.
The real part of a complex array.
The shape of the array as a Python tuple.
Number of elements in the array.