Fix broadcast_all crashing on Tensor-likes (#48169)
Summary:
This ensures Tensor-likes that implement `__torch_function__` are properly handled by `torch.distributions.utils.broadcast_all`. See Issue https://github.com/pytorch/pytorch/issues/37141 .
In this implementation, Number's will not be cast to the dtype of Tensor-likes.
Fixes https://github.com/pytorch/pytorch/issues/37141
Pull Request resolved: https://github.com/pytorch/pytorch/pull/48169
Reviewed By: izdeby
Differential Revision: D25091414
Pulled By: walterddr
fbshipit-source-id: c5c99374b02409393a68dcb85e2f8feab154318f