Fallback kernels (#18443)
authorSebastian Messmer <messmer@fb.com>
Sat, 30 Mar 2019 07:03:46 +0000 (00:03 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 30 Mar 2019 07:07:34 +0000 (00:07 -0700)
commit2a58fd9844d4413c186df6129836d88b658d3513
tree202d83214a6d947f35251ea9caf133eaaac50f48
parentf4e87e193a06309923ed1b5df153d4a1922459c8
Fallback kernels (#18443)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18443

Allow registering a kernel without a dispatch key. In this case, the kernel becomes a fallback kernel that is called whenever no other kernel matches.
This is also useful for the legacy function based API (since that API doesn't know about dispatch keys) or any other custom ops that don't care about dispatch
and just want one kernel to be called no matter the dispatch key.

Reviewed By: dzhulgakov

Differential Revision: D14603258

fbshipit-source-id: 242dc8871dad2989ca25079854d0cc97429e7199
aten/src/ATen/core/dispatch/DispatchTable.h
aten/src/ATen/core/dispatch/Dispatcher.cpp
aten/src/ATen/core/dispatch/Dispatcher.h
aten/src/ATen/core/op_registration/op_registration.cpp
aten/src/ATen/core/op_registration/op_registration_test.cpp