Since #741 was merged, it should now be possible to perform data transfers across devices and namespaces in a standard, namespace agnostic way (as long as both namespace have a shared understanding of a common device type, such as the CPU/host).
However, such transfers cannot reuse pre-allocated buffers in the target namespace/device.
Would it be possible to add an out argument to from_dlpack?
defmove(x, y):
xp_x=x.__array_namespace__()
xp_y=y.__array_namespace__()
ifnotxp_x==xp_y:
xp_x.from_dlpack(y, copy=True, out=x) # device=x.device is implicit in this case.else:
x[:] =y
This API might be a bit too weird. I am open a to better suggestions.
Since #741 was merged, it should now be possible to perform data transfers across devices and namespaces in a standard, namespace agnostic way (as long as both namespace have a shared understanding of a common device type, such as the CPU/host).
However, such transfers cannot reuse pre-allocated buffers in the target namespace/device.
Would it be possible to add an
outargument tofrom_dlpack?This API might be a bit too weird. I am open a to better suggestions.