Adds DLPack support (#57110)
Summary:
Partially Fixes https://github.com/pytorch/pytorch/issues/55090
Depends on https://github.com/pytorch/pytorch/issues/55365
Inspired by https://github.com/dmlc/dlpack/issues/57#issuecomment-774482973
Questions, in PyTorch we can't create streams or easily synchronize them from just an integer. Should we add an [`ExternalStream`](https://docs.cupy.dev/en/stable/reference/generated/cupy.cuda.ExternalStream.html) object like the one we have in CuPy?
TODO: Add tests
Would like some feedback as this design needs quite a few iterations
rgommers leofang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57110
Reviewed By: saketh-are
Differential Revision: D30761481
Pulled By: mruberry
fbshipit-source-id: e85d78df3c1f8defc2a698878da89cd843cb1209