MCPcopy Create free account
hub / github.com/mpi4py/mpi4py / BaseDLPackCPU

Class BaseDLPackCPU

test/arrayimpl.py:266–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264
265
266class BaseDLPackCPU:
267 #
268 def __dlpack_device__(self):
269 return (dlpack.DLDeviceType.kDLCPU, 0)
270
271 def __dlpack__(self, stream=None):
272 assert stream is None
273 managed = dlpack.make_dl_managed_tensor(self.array)
274 capsule = dlpack.make_py_capsule(managed, owned=True)
275 return capsule
276
277 def as_raw(self):
278 return self
279
280
281if dlpack is not None and array is not None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…