legate.core.allocation.InlineMappedAllocation.consume#

InlineMappedAllocation.consume(ctor: Callable[[tuple[int, ...], int, tuple[int, ...]], Any]) Any#

Consumes the allocation. Each allocation can be consumed only once.

Parameters:

ctor (Callback) – Callback that constructs a Python object from the allocation. Each callback gets the shape, the physical address, and the strides of the allocation, and is supposed to return a Python object using the allocation. Leaking the three arguments in some other way will lead to an undefined behavior.

Returns:

Python object the callback constructs from the allocation

Return type:

Any