Add get input and output names (#2890)

This commit is contained in:
Cai Shanli
2021-05-17 19:11:37 +08:00
committed by GitHub
parent afc02d57f9
commit 8cc8cd716a
6 changed files with 134 additions and 56 deletions
+8
View File
@@ -884,6 +884,14 @@ PYBIND11_MODULE(ncnn, m)
.def("clear", &Net::clear)
.def("create_extractor", &Net::create_extractor, py::keep_alive<0, 1>()) //net should be kept alive until retuned ex is freed by gc
.def("input_indexes", &Net::input_indexes, py::return_value_policy::reference)
.def("input_indexes", &Net::output_indexes, py::return_value_policy::reference)
#if NCNN_STRING
.def("input_names", &Net::input_names, py::return_value_policy::reference)
.def("output_names", &Net::output_names, py::return_value_policy::reference)
#endif // NCNN_STRING
.def("blobs", &Net::blobs, py::return_value_policy::reference_internal)
.def("layers", &Net::layers, py::return_value_policy::reference_internal);