pytorch/torch/sparse
Pearu Peterson c5ad44be1d Add torch.sparse.as_sparse_gradcheck decorator of gradcheck that allows gradcheck input function to receive and return sparse tensors (#107150)
Compared to #104848, this PR makes a step further: when the enable_sparse_support decorator is applied to `torch.autograd.gradcheck`, the resulting callable is equivalent to `torch.autograd.gradcheck` with an extra feature of supporting functions that can have input sparse tensors or/and can return sparse tensors.

At the same time, the underlying call to `torch.autograd.gradcheck` will operate on strided tensors only. This basically means that torch/autograd/gradcheck.py can be cleaned up by removing the code that deals with sparse tensors.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/107150
Approved by: https://github.com/albanD, https://github.com/amjames, https://github.com/cpuhrsch
ghstack dependencies: #107638, #107777
2023-08-26 07:24:31 +00:00
..
__init__.py Add torch.sparse.as_sparse_gradcheck decorator of gradcheck that allows gradcheck input function to receive and return sparse tensors (#107150) 2023-08-26 07:24:31 +00:00
_semi_structured_conversions.py Make conversions from/to sparse semi-structured always @torch.compile-d (#105272) 2023-07-18 04:51:28 +00:00
_triton_ops.py SDPA: frontend for BSR masks (#104042) 2023-07-13 18:01:21 +00:00
semi_structured.py [core][sparse][pruning] cuSPARSELt Kernels and ops. (#107398) 2023-08-25 07:04:15 +00:00