[RELAND] Fix Dispatching not considering List[Optional[Tensor]] for dispatch (#68073)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68073
Relanding the original PR. Its body was as follows:
Followup to https://github.com/pytorch/pytorch/pull/60787
It turns out that the original PR was wrong for unboxed kernels. We
recently ran into this in
https://github.com/facebookresearch/functorch/issues/124
For unboxed kernels, the correct type for a Tensor?[] argument is
actually `List<optional<Tensor>>`, not `ArrayRef<optional<Tensor>>`
ghstack-source-id: 144204580
Test Plan:
- assert that https://github.com/facebookresearch/functorch/issues/124
actually works
Reviewed By: gchanan
Differential Revision: D32313601
Pulled By: zou3519
fbshipit-source-id: 8028d5f34eecabc53d603bd54d6b6748b5db461a