GitOrigin-RevId: 794a8847aa
tags/v1.6.0-rc1
@@ -66,7 +66,9 @@ void init_common(py::module m) { | |||||
.def_static("_get_default_device", &get_default_device) | .def_static("_get_default_device", &get_default_device) | ||||
.def("__str__", &CompNode::to_string_logical) | .def("__str__", &CompNode::to_string_logical) | ||||
.def("__repr__", [](const CompNode& cn) { | .def("__repr__", [](const CompNode& cn) { | ||||
return py::str("\"" + cn.to_string() + "\" from \"" + cn.to_string_logical() + "\""); | |||||
return mgb::ssprintf("CompNode(\"%s\" from \"%s\")", | |||||
cn.to_string_physical().c_str(), | |||||
cn.to_string_logical().c_str()); | |||||
}) | }) | ||||
.def_static("_sync_all", &CompNode::sync_all) | .def_static("_sync_all", &CompNode::sync_all) | ||||
.def(py::self == py::self) | .def(py::self == py::self) | ||||
@@ -1,10 +0,0 @@ | |||||
test/resource/input_data.npy filter=lfs diff=lfs merge=lfs -text | |||||
test/resource/lite/shufflenet.mge filter=lfs diff=lfs merge=lfs -text | |||||
test/resource/lite/shufflenet_crypt_aes.mge filter=lfs diff=lfs merge=lfs -text | |||||
test/resource/lite/test_packed_model.lite filter=lfs diff=lfs merge=lfs -text | |||||
test/resource/lite/test_packed_model_rc4.lite filter=lfs diff=lfs merge=lfs -text | |||||
test/resource/lite/output_data.npy filter=lfs diff=lfs merge=lfs -text | |||||
test/resource/lite/model.mgb filter=lfs diff=lfs merge=lfs -text | |||||
test/resource/lite/liveness_rgb_nosub128.rknn filter=lfs diff=lfs merge=lfs -text | |||||
third_party/librknn_api filter=lfs diff=lfs merge=lfs -text | |||||
test/resource/lite/model_atlas.mgb filter=lfs diff=lfs merge=lfs -text |
@@ -368,8 +368,15 @@ class CompNode { | |||||
//! change to another stream on the same memory node | //! change to another stream on the same memory node | ||||
CompNode change_stream(int dest_stream) const; | CompNode change_stream(int dest_stream) const; | ||||
//! get string representation of physical device | |||||
//! get string representation | |||||
std::string to_string() const { | std::string to_string() const { | ||||
return m_impl ? mgb::ssprintf("CompNode(\"%s\" from \"%s\")", | |||||
to_string_physical().c_str(), | |||||
to_string_logical().c_str()) : "invalid"; | |||||
} | |||||
//! get string representation of physical device | |||||
std::string to_string_physical() const { | |||||
return m_impl ? m_impl->locator().to_string() : "invalid"; | return m_impl ? m_impl->locator().to_string() : "invalid"; | ||||
} | } | ||||