提交 e41041de 编写于 作者: S superjom

fix test

上级 31a2a715
......@@ -8,7 +8,7 @@ from storage_mock import add_scalar, add_image
class LibTest(unittest.TestCase):
def setUp(self):
dir = "./tmp/mock"
writer = storage.StorageWriter(dir, sync_cycle=20)
writer = storage.LogWriter(dir, sync_cycle=20)
add_scalar(writer, "train", "layer/scalar0/min", 1000, 1)
add_scalar(writer, "test", "layer/scalar0/min", 1000, 10)
......
......@@ -11,10 +11,10 @@ namespace cp = visualdl::components;
PYBIND11_PLUGIN(core) {
py::module m("core", "C++ core of VisualDL");
#define READER_ADD_SCALAR(T) \
#define READER_ADD_SCALAR(T) \
.def("get_scalar_" #T, [](vs::LogReader& self, const std::string& tag) { \
auto tablet = self.tablet(tag); \
return vs::components::ScalarReader<T>(std::move(tablet)); \
auto tablet = self.tablet(tag); \
return vs::components::ScalarReader<T>(std::move(tablet)); \
})
py::class_<vs::LogReader>(m, "LogReader")
.def("__init__",
......@@ -35,10 +35,10 @@ PYBIND11_PLUGIN(core) {
});
#undef READER_ADD_SCALAR
#define WRITER_ADD_SCALAR(T) \
#define WRITER_ADD_SCALAR(T) \
.def("new_scalar_" #T, [](vs::LogWriter& self, const std::string& tag) { \
auto tablet = self.AddTablet(tag); \
return cp::Scalar<T>(tablet); \
auto tablet = self.AddTablet(tag); \
return cp::Scalar<T>(tablet); \
})
py::class_<vs::LogWriter>(m, "LogWriter")
......@@ -93,10 +93,7 @@ PYBIND11_PLUGIN(core) {
py::class_<cp::ImageReader::ImageRecord>(m, "ImageRecord")
// TODO(ChunweiYan) make these copyless.
.def("data",
[](cp::ImageReader::ImageRecord& self) {
return self.data;
})
.def("data", [](cp::ImageReader::ImageRecord& self) { return self.data; })
.def("shape",
[](cp::ImageReader::ImageRecord& self) { return self.shape; })
.def("step_id",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册