#include #include #include #include template using shared_ptr_class_ = py::class_>; void THCPMemPool_init(PyObject* module) { auto torch_C_m = py::handle(module).cast(); shared_ptr_class_<::c10::cuda::MemPool>(torch_C_m, "_MemPool") .def(py::init()) .def_property_readonly("id", &::c10::cuda::MemPool::id) .def_property_readonly("allocator", &::c10::cuda::MemPool::allocator); shared_ptr_class_<::c10::cuda::MemPoolContext>(torch_C_m, "_MemPoolContext") .def(py::init()) .def_static( "active_pool", &::c10::cuda::MemPoolContext::getActiveMemPool); }