Generalize sparse construction to work with arbitrary device types (#81796)
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81796
Approved by: https://github.com/cpuhrsch, https://github.com/bdhirsh