Yukio Siraichi
a10f15718d
[DLPack] Add support for missing keyword-arguments. ( #150218 )
...
This PR introduces the rest of the keyword-arguments added in DLPack
version 2023.12: `dl_device` and `copy`.
In summary, we handle these arguments in the C++ implementation of
`to_dlpack(...)` at _torch/csrc/Module.cpp_, by calling the
`maybeCopyTensor` function at _aten/src/ATen/DLConvertor.cpp_. It also
introduces the following changes:
- Add a new Python API `torchDeviceToDLDevice()`, which is simply a
refactoring of the `getDLDevice()` function at
_aten/src/ATen/DLConvertor.cpp_.
- Add both keyword-arguments to the `from_dlpack()` function at
_torch/utils/dlpack.py_ and to the `Tensor.__dlpack__()` dunder
method.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/150218
Approved by: https://github.com/albanD
ghstack dependencies: #150216 , #150217
2025-07-20 00:46:20 +00:00
..
2025-07-20 00:46:20 +00:00
2025-06-12 23:04:11 +00:00
2025-07-18 23:24:21 +00:00
2025-06-22 15:52:27 +00:00
2025-07-19 00:59:54 +00:00
2025-07-17 18:09:56 +00:00
2025-07-18 04:58:24 +00:00
2025-07-18 07:16:50 +00:00
2025-07-19 04:54:38 +00:00
2025-07-12 05:47:06 +00:00
2025-07-17 05:56:07 +00:00
2025-07-18 22:02:31 +00:00
2025-07-16 08:11:53 +00:00
2025-07-12 05:47:06 +00:00
2025-07-12 05:47:06 +00:00
2025-07-12 05:47:06 +00:00
2025-07-12 05:47:06 +00:00
2025-07-18 22:02:31 +00:00
2025-07-17 01:56:01 +00:00
2025-07-14 05:24:23 +00:00
2025-07-17 18:46:44 +00:00
2025-07-15 19:49:38 +00:00
2025-07-15 17:46:43 +00:00
2025-07-18 04:58:24 +00:00
2025-05-14 06:29:16 +00:00
2025-07-20 00:46:20 +00:00
2025-07-19 00:32:04 +00:00
2025-07-19 04:54:38 +00:00
2025-07-09 11:02:22 +00:00
2025-07-16 23:31:10 +00:00
2025-06-17 08:18:47 +00:00
2025-02-06 18:48:09 +00:00
2025-07-08 15:39:56 +00:00
2025-07-18 10:34:55 -05:00
2025-07-18 14:35:20 +00:00
2025-07-16 20:01:34 +00:00
2025-06-19 23:26:42 +00:00
2025-06-04 21:15:20 +00:00
2025-07-08 18:10:33 +00:00
2025-02-01 23:24:52 +00:00
2025-07-02 22:55:29 +00:00
2025-06-17 08:18:47 +00:00
2025-07-02 22:55:29 +00:00
2025-07-20 00:28:09 +00:00
2025-07-10 00:34:39 +00:00
2025-07-18 05:33:45 +00:00
2025-07-18 10:34:55 -05:00
2025-07-19 07:27:15 +00:00
2025-07-11 15:16:20 +00:00
2025-07-09 22:07:50 +00:00
2025-06-23 02:57:34 +00:00
2025-06-23 02:57:34 +00:00
2025-07-09 11:24:27 +00:00
2025-06-23 02:57:34 +00:00
2025-07-17 20:14:29 +00:00
2025-07-20 00:46:20 +00:00
2025-06-23 02:57:34 +00:00
2025-07-17 05:56:07 +00:00
2025-04-27 09:56:42 +00:00
2025-07-08 00:11:52 +00:00
2025-06-10 16:13:38 +00:00
2025-05-21 01:03:26 +00:00
2025-07-10 23:11:18 +00:00
2025-07-09 11:02:22 +00:00
2025-07-09 18:22:14 +00:00
2025-07-09 11:02:22 +00:00
2025-07-09 11:02:22 +00:00
2025-07-17 16:20:02 +00:00
2025-07-19 00:45:31 +00:00
2025-06-14 03:37:38 +00:00
2025-05-21 01:03:26 +00:00
2025-06-05 14:30:49 +00:00
2025-07-10 19:22:52 +00:00
2025-06-14 01:04:12 +00:00
2025-07-20 00:46:20 +00:00
2025-07-16 19:15:33 +00:00
2025-07-17 05:56:07 +00:00
2025-07-09 11:02:22 +00:00
2025-04-27 09:56:42 +00:00
2025-02-25 23:51:12 +00:00
2025-07-15 19:52:59 +00:00
2025-07-09 11:02:22 +00:00
2025-07-09 11:02:22 +00:00
2025-07-18 14:35:20 +00:00
2025-07-09 11:02:22 +00:00
2025-07-09 11:02:22 +00:00
2025-07-17 05:56:07 +00:00
2025-07-20 00:46:20 +00:00
2025-04-23 16:59:29 +00:00
2025-07-17 22:17:52 +00:00
2025-06-14 18:18:43 +00:00
2025-02-04 19:18:23 +00:00
2025-01-28 05:29:12 +00:00