提交 1ce78aa0 编写于 作者: M Megvii Engine Team

fix(imperative): destruct dnn handles at last

GitOrigin-RevId: 7a67c68c55f56ef997758319d5c047c822c89e8b
上级 0cb60d64
......@@ -24,7 +24,8 @@ namespace megdnn {
* Usually used for calling other opr impls from some opr impl. You probably
* want to use CpuOprDelegationStorage instead.
*/
const std::shared_ptr<Handle>& inplace_cpu_handle(int debug_level = 0);
MGE_WIN_DECLSPEC_FUC const std::shared_ptr<Handle>& inplace_cpu_handle(
int debug_level = 0);
/*!
* \brief storage for oprs on inplace CPU handle
......
......@@ -14,6 +14,7 @@
#define DO_IMPORT_ARRAY
#include "./helper.h"
#include "./numpy_dtypes.h"
#include "megdnn/handle.h"
#include "./common.h"
#include "./graph_rt.h"
......@@ -30,6 +31,10 @@ using namespace mgb::imperative::python;
#define MODULE_NAME imperative_rt
#endif
namespace megdnn {
extern const std::shared_ptr<Handle>& inplace_cpu_handle(int debug_level = 0);
}
PYBIND11_MODULE(MODULE_NAME, m) {
// initialize numpy
if ([]() {
......@@ -39,6 +44,8 @@ PYBIND11_MODULE(MODULE_NAME, m) {
throw py::error_already_set();
}
megdnn::inplace_cpu_handle();
py::module::import("sys").attr("modules")[m.attr("__name__")] = m;
m.attr("__package__") = m.attr("__name__");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册