Implement backend fallback fallthrough (#32439)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/32439
This adds c10::fallthrough_kernel which is a special boxed function which
can be used to implement fallthrough behavior at a dispatch key. A fallthrough
kernel will redispatch to the next valid dispatch key. It is implemented
in such a way that it costs no more to fallthrough than it does to go
straight to the actual implementation of the kernel.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Differential Revision: D19503886
Test Plan: Imported from OSS
Pulled By: ezyang
fbshipit-source-id: 6ee05bd815c4ef444e612d19f62312dbb76f2787