WasmGPU.python.toCPU¶
Summary¶
WasmGPU.python.toCPU copies a validated Python buffer into a new owning CPUndarray.
The returned ndarray has the source dtype and shape and remains valid after the Python buffer proxy is released.
Syntax¶
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
src |
PythonArraySource |
Yes | C-contiguous Python buffer or proxy exposing getBuffer(). |
Returns¶
CPUndarray - New owning CPU ndarray containing a copy of the source data.
Type Details¶
The source must be C-contiguous and use i8, u8, i16, u16, i32, u32, f32, or f64. Shape, strides, offset, item size, and byte range are validated before allocation. A buffer acquired through getBuffer() is released even when validation or copying fails.