MCPcopy Create free account
hub / github.com/NVIDIA/DALI / cupy_adapter

Function cupy_adapter

dali/test/python/test_dltensor_operator.py:202–206  ·  view source on GitHub ↗
(fun, in1, in2)

Source from the content-addressed store, hash-verified

200
201
202def cupy_adapter(fun, in1, in2):
203 tin1 = [cupy.from_dlpack(dltensor) for dltensor in in1]
204 tin2 = [cupy.from_dlpack(dltensor) for dltensor in in2]
205 tout1, tout2 = fun(tin1, tin2)
206 return [tout.__dlpack__() for tout in tout1], [tout.__dlpack__() for tout in tout2]
207
208
209def cupy_wrapper(fun, synchronize):

Callers 1

cupy_wrapperFunction · 0.85

Calls 3

funFunction · 0.85
from_dlpackMethod · 0.80
__dlpack__Method · 0.45

Tested by

no test coverage detected