AsyncGpuResult#

class nvmolkit.types.AsyncGpuResult(obj)#

Handle to a GPU result.

Populates the __cuda_array_interface__ attribute which can be consumed by other libraries. Note that this result is async, and the data cannot be accessed without a sync, such as torch.cuda.synchronize().

# TODO: Handle devices and streams.

__init__(obj)#

Internal construction of the AsyncGpuResult object.

property device#

Return the device of the underlying data.

torch()#

Return the underlying data as a torch tensor. This is an asynchronous operation.

numpy()#

Return the underlying data as a numpy array. This is a blocking operation.