Add zero input support for batch permutation op (#39851)
Summary:
Batch permutation op does not support zero input now, it can output a tensor the same as the input if the first dimension is zero.
This can be solved: facebookresearch/detectron2#1580
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39851
Reviewed By: houseroad
Differential Revision: D22033207
Pulled By: ppwwyyxx
fbshipit-source-id: 73b540d2182fe85ed9a47220237a8f213d68ae16