Skip to content
fn

make_zero_storage

→Storage
int make_zero_storage(const int & shape, Dtype dtype, Device device)

Allocate a zero-filled Storage on the requested device.

Parameters

shapeconst Shape&
N-D shape of the resulting storage.
dtypeDtype
Element dtype.
deviceDevice
Target device (CPU uses Accelerate; GPU allocates an MLX array).

Returns

Storage

Newly allocated storage with every element equal to zero.