probly.representation.array_like.NumpyArrayLike

class probly.representation.array_like.NumpyArrayLike(*args, **kwargs)[source]

Bases: ArrayLike, Protocol, Generic

Protocol for array-like objects that implement NumPy-specific APIs.

property T: Self

Transposed view.

astype(dtype: DTypeLike, order: Order = 'K', casting: Literal['no', 'equiv', 'safe', 'same_kind', 'unsafe'] = 'unsafe', subok: bool = True, copy: bool = True) Self[source]

Return cast array.

copy(order: Order = 'C') Self[source]

Return array copy.

property device: Any

Device of the array.

property dtype: dtype

Data type of the array.

property flags: ArrayFlagsLike

The flags of the array.

property mT: Self

Matrix-transposed view.

property ndim: int

Number of dimensions.

property shape: tuple[int, ...]

Shape of the array.

property size: int

Number of elements in the array.

to_device(device: Literal['cpu'], /, *, stream: int | Any | None = None) Self[source]

Move the array to a device.

transpose(*axes: int | None) Self[source]

Return transposed array.