forked from jiuyuan/InfiniTensor
parent
afa90ec9c9
commit
391b9d16c0
|
@ -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),
|
||||||
|
|
Loading…
Reference in New Issue