8000 Update · pytorch/pytorch@476b1ea · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 476b1ea

Browse files
committed
Update
[ghstack-poisoned]
2 parents d32a334 + 890e79a commit 476b1ea

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

torch/_tensor.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,8 @@ def __dlpack__(self, stream=None, max_version=None):
16961696
None (default), PyTorch will fallback to DLPack 0.8.
16971697
"""
16981698
if has_torch_function_unary(self):
1699-
return handle_torch_function(Tensor.__dlpack__, (self,), self, stream)
1699+
args = (self, stream, max_version)
1700+
return handle_torch_function(Tensor.__dlpack__, (self,), *args)
17001701

17011702
# DLPack capsules can't capture all of PyTorch's semantics,
17021703
# so we prohibit exporting tensors that would lose their properties like

torch/overrides.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ def get_testing_overrides() -> dict[Callable, Callable]:
15111511
Tensor.view: lambda self, shape: -1,
15121512
Tensor.view_as: lambda self, other: -1,
15131513
Tensor.zero_: lambda self: -1,
1514-
Tensor.__dlpack__: lambda self, stream=None: -1,
1514+
Tensor.__dlpack__: lambda self, stream=None, max_version=None: -1,
15151515
Tensor.__dlpack_device__: lambda self: -1,
15161516
torch.linalg.lstsq: lambda self, b, cond=None, driver=None: -1,
15171517
} # fmt: skip

0 commit comments

Comments
 (0)
0