Commit f603c46
committed
DOC: clarify DLPack GPU tensor example with device='cpu' workaround
Update the DLPack example in the interoperability docs to show that
since DLPack v1, cross-device copy is supported via the device parameter.
The example now shows that np.from_dlpack(x_torch, device='cpu') works
for GPU tensors.
Closes numpy#309361 parent d7f2450 commit f603c46
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
491 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
492 | 493 | | |
493 | 494 | | |
494 | | - | |
| 495 | + | |
495 | 496 | | |
496 | 497 | | |
497 | 498 | | |
| 499 | + | |
| 500 | + | |
498 | 501 | | |
499 | | - | |
| 502 | + | |
500 | 503 | | |
501 | 504 | | |
502 | 505 | | |
| |||
0 commit comments