Add torch.can_cast(from, to) function (#26805)
Summary:
https://github.com/pytorch/pytorch/issues/25472
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26805
Differential Revision: D17628434
Pulled By: nairbv
fbshipit-source-id: 6af8031ac3afda1505d338075c0637ad043f8b7e