[CUDA][DLPack] Handle legacy default streams for DLPack conversion (#101318)
It seems that some legacy default stream logic (e.g., present in https://github.com/pytorch/pytorch/blob/a8ff647e4233625d5f5840d46c93b00471c18fe8/torch/utils/dlpack.py#L114 ) is not handled on the potential receiving end in `torch/_tensor.py`.
Open to suggestions on how to make the test case less clunky, as this was the combination we arrived at after discovering flakiness in alternate versions.
Thanks to Olga Andreeva for surfacing this issue and providing a repro.
CC @Aidyn-A @ngimel
Pull Request resolved: https://github.com/pytorch/pytorch/pull/101318
Approved by: https://github.com/ngimel