Arrays#

Array creation and debugging helper function. For example:

>>> a = hpk.empty([3, 5, 7], dtype=np.float64)
>>> hpk.inspect(a)
>>> b = hpk.empty([3, 5, 7], dtype=np.complex128)
>>> b.setflags(write=False)
>>> hpk.inspect(b)

FUNCTIONS

hpk.empty(n: int, dtype: object) ArrayLike#
hpk.empty(shape: Sequence[int], dtype: object) ArrayLike

Overloaded function.

  1. empty(n: int, dtype: object) -> ArrayLike

Return a new 1D array of n elements of type dtype, without initializing entries. The array is aligned to a cacheline boundary.

  1. empty(shape: Sequence[int], dtype: object) -> ArrayLike

Return a new array of given shape and type, without initializing entries. The array has row-major (C-style) order in memory and is aligned to a cacheline boundary.


hpk.inspect(a: ndarray[]) None#
hpk.inspect(a: ndarray[writable=False] | None) None

Overloaded function.

  1. inspect(a: ndarray[]) -> None

Prints information about the array. The shape is given in dtype units, which may be complex. The stride is given in real units.

  1. inspect(a: ndarray[writable=False] | None) -> None

Prints information about the array. The shape is given in dtype units, which may be complex. The stride is given in real units.