Add meta device support to sparse compressed tensors (#120498)

As in the title.

Unblocks https://github.com/pytorch/pytorch/pull/117907#discussion_r1499251745

Pull Request resolved: https://github.com/pytorch/pytorch/pull/120498
Approved by: https://github.com/ezyang
This commit is contained in:
Pearu Peterson
2024-02-24 22:40:45 +02:00
committed by PyTorch MergeBot
parent 834c7a1d3e
commit 5d71ba6885
10 changed files with 130 additions and 40 deletions

View File

@ -84,6 +84,7 @@ class DispatchKey(Enum):
Sparse = auto()
SparseCsrCPU = auto()
SparseCsrCUDA = auto()
SparseCsrMeta = auto()
NestedTensor = auto()
Dense = auto()
@ -260,6 +261,7 @@ dispatch_keys = [
# kernels
DispatchKey.Meta,
DispatchKey.SparseMeta,
DispatchKey.SparseCsrMeta,
DispatchKey.QuantizedMeta,
DispatchKey.NestedTensorMeta,
DispatchKey.ZeroTensor,