Signed-off-by: YdrMaster <ydrml@hotmail.com>
This commit is contained in:
YdrMaster 2023-02-15 14:08:30 +08:00
parent afa90ec9c9
commit 391b9d16c0
1 changed files with 0 additions and 3 deletions

View File

@ -28,16 +28,13 @@ void init_graph_builder(py::module &m) {
py::class_<RuntimeObj, std::shared_ptr<RuntimeObj>>(m, "RuntimeObj"); py::class_<RuntimeObj, std::shared_ptr<RuntimeObj>>(m, "RuntimeObj");
py::class_<CpuRuntimeObj, std::shared_ptr<CpuRuntimeObj>, RuntimeObj>( py::class_<CpuRuntimeObj, std::shared_ptr<CpuRuntimeObj>, RuntimeObj>(
m, "CpuRuntimeObj"); m, "CpuRuntimeObj");
py::class_<Shape>(m, "Shape");
py::class_<TensorObj, std::shared_ptr<TensorObj>>(m, "TensorObj"); py::class_<TensorObj, std::shared_ptr<TensorObj>>(m, "TensorObj");
py::class_<Tensor>(m, "Tensor");
py::enum_<ActType>(m, "ActType") py::enum_<ActType>(m, "ActType")
.value("Linear", ActType::None) // None 是 Python 关键字,不能用 .value("Linear", ActType::None) // None 是 Python 关键字,不能用
.value("Relu", ActType::Relu) .value("Relu", ActType::Relu)
.value("Sigmoid", ActType::Sigmoid) .value("Sigmoid", ActType::Sigmoid)
.value("Tanh", ActType::Tanh) .value("Tanh", ActType::Tanh)
.export_values(); .export_values();
py::class_<GraphHandler>(m, "GraphHandler");
py::class_<Handler>(m, "GraphHandlerObj") py::class_<Handler>(m, "GraphHandlerObj")
.def(py::init<Runtime>()) .def(py::init<Runtime>())
.def("tensor", py::overload_cast<Shape, int>(&Handler::tensor), .def("tensor", py::overload_cast<Shape, int>(&Handler::tensor),