mlx.core.array

mlx.core.array#

class array(*args, **kwargs)#

N 維陣列物件。

__init__(self: array, val: scalar | list | tuple | ndarray | array, dtype: Dtype | None = None)#

方法

__init__(self, val[, dtype])

abs(self, *[, stream])

請參見 abs()

all(self[, axis, keepdims, stream])

請參見 all()

any(self[, axis, keepdims, stream])

請參見 any()

argmax(self[, axis, keepdims, stream])

請參見 argmax()

argmin(self[, axis, keepdims, stream])

請參見 argmin()

astype(self, dtype[, stream])

將陣列轉型為指定型別。

conj(self, *[, stream])

請參見 conj()

cos(self, *[, stream])

請參見 cos()

cummax(self[, axis, reverse, inclusive, stream])

請參見 cummax()

cummin(self[, axis, reverse, inclusive, stream])

請參見 cummin()

cumprod(self[, axis, reverse, inclusive, stream])

請參見 cumprod()

cumsum(self[, axis, reverse, inclusive, stream])

請參見 cumsum()

diag(self[, k, stream])

擷取對角線或建構對角矩陣。

diagonal(self[, offset, axis1, axis2, stream])

請參見 diagonal()

exp(self, *[, stream])

請參見 exp()

flatten(self[, start_axis, end_axis, stream])

請參見 flatten()

item(self)

Access the value of a scalar array.

log(self, *[, stream])

請參見 log()

log10(self, *[, stream])

請參見 log10()

log1p(self, *[, stream])

See log1p().

log2(self, *[, stream])

請參見 log2()

logcumsumexp(self[, axis, reverse, ...])

請參見 logcumsumexp()

logsumexp(self[, axis, keepdims, stream])

See logsumexp().

max(self[, axis, keepdims, stream])

請參見 max()

mean(self[, axis, keepdims, stream])

See mean().

min(self[, axis, keepdims, stream])

請參見 min()

moveaxis(self, source, destination, *[, stream])

See moveaxis().

prod(self[, axis, keepdims, stream])

See prod().

reciprocal(self, *[, stream])

請參見 reciprocal()

reshape(self, *shape[, stream])

Equivalent to reshape() but the shape can be passed either as a tuple or as separate arguments.

round(self[, decimals, stream])

請參見 round()

rsqrt(self, *[, stream])

請參見 rsqrt()

sin(self, *[, stream])

請參見 sin()

split(self, indices_or_sections[, axis, stream])

See split().

sqrt(self, *[, stream])

請參見 sqrt()

square(self, *[, stream])

請參見 square()

squeeze(self[, axis, stream])

請參見 squeeze()

std(self[, axis, keepdims, ddof, stream])

See std().

sum(self[, axis, keepdims, stream])

See sum().

swapaxes(self, axis1, axis2, *[, stream])

請參見 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])

請參見 var()

view(self, dtype, *[, stream])

請參見 view()

Attributes

T

等同於呼叫 self.transpose() 且不帶參數。

at

用於在指定索引處套用更新。

dtype

陣列的 Dtype

imag

The imaginary part of a complex array.

itemsize

The size of the array's datatype in bytes.

nbytes

The number of bytes in the array.

ndim

The array's dimension.

real

The real part of a complex array.

shape

以 Python tuple 表示的陣列形狀。

size

陣列中的元素數量。