Reland "Add test for empty tensors for batch matmuls" (#48797)
Summary:
This reverts commit c7746adbc6e6ace9d4c2b54e32c8d36a7b7b0e31.
Fixes #{issue number}
Pull Request resolved: https://github.com/pytorch/pytorch/pull/48797
Reviewed By: mruberry
Differential Revision: D25575264
Pulled By: ngimel
fbshipit-source-id: c7f3b384db833d727bb5bd8a51f1493a13016d09