kernelkit.data.aspitched

Contents

kernelkit.data.aspitched#

kernelkit.data.aspitched(array, xp=None)#

Pads array to pitched shape and returns a view in original shape.

This function can also be used to transfer a non-pitched CPU array to a pitched GPU array, by setting xp to cp.

Parameters:
arrayarray-like

The array to pad to pitched shape.

xparray module, optional

Array module used for the new array in the pitched shape. If None, the module of the given array is used.

Returns:
array-like

A view of the array in the original shape.