I have followed your suggestion regarding QNNPACK , but I faced some other error as follows:
Do you have any idea ?
[ 56%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state.dir/python/pybind_state_dlpack.cc.o
[ 56%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCTensorMath.cu.o
[ 56%] Building CXX object caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/Cuda.cpp.o
[ 56%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCTensorMathBlas.cu.o
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc: In lambda function:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:346:32: error: ‘const class pybind11::object’ has no member named ‘is’
             if (!device_option.is(py::none())) {
                                ^~
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc: In function ‘void caffe2::python::addObjectMethods(pybind11::module&)’:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:682:8: error: no matching function for call to ‘init(caffe2::python::addObjectMethods(pybind11::module&)::<lambda(const std::vector<pybind11::bytes>&, const std::vector<pybind11::bytes>&, const std::vector<std::__cxx11::basic_string<char> >&)>)’
       }));
        ^
In file included from /home/phung/Downloads/pytorch/caffe2/python/pybind_state_dlpack.h:9:0,
                 from /home/phung/Downloads/pytorch/caffe2/python/pybind_state.h:16,
                 from /home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:1:
/usr/include/pybind11/pybind11.h:1418:51: note: candidate: template<class ... Args> pybind11::detail::init<Args ...> pybind11::init()
 template <typename... Args> detail::init<Args...> init() { return detail::init<Args...>(); }
                                                   ^~~~
/usr/include/pybind11/pybind11.h:1418:51: note:   template argument deduction/substitution failed:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:682:8: note:   candidate expects 0 arguments, 1 provided
       }));
        ^
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc: In lambda function:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:689:22: error: ‘const class pybind11::object’ has no member named ‘is’
             if (args.is(py::none())) {
                      ^~
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc: In function ‘void caffe2::python::addObjectMethods(pybind11::module&)’:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:884:12: error: no matching function for call to ‘init(caffe2::python::addObjectMethods(pybind11::module&)::<lambda(pybind11::bytes, pybind11::bytes)>)’
           }))
            ^
In file included from /home/phung/Downloads/pytorch/caffe2/python/pybind_state_dlpack.h:9:0,
                 from /home/phung/Downloads/pytorch/caffe2/python/pybind_state.h:16,
                 from /home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:1:
/usr/include/pybind11/pybind11.h:1418:51: note: candidate: template<class ... Args> pybind11::detail::init<Args ...> pybind11::init()
 template <typename... Args> detail::init<Args...> init() { return detail::init<Args...>(); }
                                                   ^~~~
/usr/include/pybind11/pybind11.h:1418:51: note:   template argument deduction/substitution failed:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:884:12: note:   candidate expects 0 arguments, 1 provided
           }))
            ^
[ 56%] Building CXX object modules/observers/CMakeFiles/caffe2_observers.dir/observer_config.cc.o
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc: In lambda function:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:1053:31: error: ‘const class pybind11::object’ has no member named ‘is’
         if (create_if_missing.is(py::none())) {
                               ^~
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc: In lambda function:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:1065:25: error: ‘const class pybind11::object’ has no member named ‘is’
         if (root_folder.is(py::none())) {
                         ^~
[ 56%] Linking CXX shared library ../../lib/libcaffe2_module_test_dynamic.so
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc: In lambda function:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:1438:28: error: ‘class pybind11::object’ has no member named ‘is’
         if (!device_option.is(py::none())) {
                            ^~
In file included from /home/phung/Downloads/pytorch/caffe2/core/logging.h:2:0,
                 from /home/phung/Downloads/pytorch/caffe2/core/allocator.h:8,
                 from /home/phung/Downloads/pytorch/caffe2/core/context.h:9,
                 from /home/phung/Downloads/pytorch/caffe2/python/pybind_state.h:5,
                 from /home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:1:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc: In lambda function:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:1492:29: error: ‘class pybind11::object’ has no member named ‘is’
         CAFFE_ENFORCE(!func.is(py::none()));
                             ^
/home/phung/Downloads/pytorch/c10/util/Logging.h:82:11: note: in definition of macro ‘CAFFE_ENFORCE’
     if (!(condition)) {                                             \
           ^~~~~~~~~
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc: In lambda function:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:1508:29: error: ‘class pybind11::object’ has no member named ‘is’
         CAFFE_ENFORCE(!func.is(py::none()));
                             ^
/home/phung/Downloads/pytorch/c10/util/Logging.h:82:11: note: in definition of macro ‘CAFFE_ENFORCE’
     if (!(condition)) {                                             \
           ^~~~~~~~~
[ 56%] Built target caffe2_module_test_dynamic
[ 56%] Building CXX object modules/observers/CMakeFiles/caffe2_observers.dir/perf_observer.cc.o
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc: At global scope:
/home/phung/Downloads/pytorch/caffe2/python/pybind_state.cc:1769:16: error: expected constructor, destructor, or type conversion before ‘(’ token
 PYBIND11_MODULE(caffe2_pybind11_state, m) {
                ^
[ 56%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state.dir/python/pybind_state_nomni.cc.o