Files
pytorch/test/cpp_extensions/dangling_impl_extension.cpp
Jiewen Tan 357c4d9cc4 Add a test case for findDanglingImpls (#61104)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61104

This patch added a new test case for findDanglingImpls. The test case introduces a C++ extension which has a dangling impl such that findDanglingImpls can find it and output its information.

Test Plan:
python test/test_dispatch.py TestDispatch.test_find_dangling_impls_ext

Imported from OSS

Reviewed By: ezyang

Differential Revision: D29512520

fbshipit-source-id: 6883fb8f065f2c0ae0e7a1adf6fd298591497e2b
2021-07-07 13:34:16 -07:00

12 lines
174 B
C++

#include <torch/extension.h>
void foo() { }
TORCH_LIBRARY_IMPL(__test, CPU, m) {
m.impl("foo", foo);
}
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
m.def("bar", foo);
}