/
vuron
/
adept
Обзор
Документация
Войти
/
vuron
/
adept
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
python/cpp_bindings/fileoutput_py.cpp
21 строка
975 B
kolkir
Refactor python folder structure
01 мар 2025, 22:16
01 мар 2025, 22:16
ef25f05
Код
Авторство
О чём код?
#include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <adept/serialize/fileoutput.hpp> namespace py = pybind11; using namespace adept; void bind_fileoutput(py::module& m) { py::class_<OutputSerializer>(m, "OutputSerializer"); py::class_<FileOutput, OutputSerializer>(m, "FileOutput") .def(py::init<std::string>()) .def("write", py::overload_cast<const std::string&, float32_t>(&FileOutput::write)) .def("write", py::overload_cast<const std::string&, float64_t>(&FileOutput::write)) .def("write", py::overload_cast<const std::string&, index_t>(&FileOutput::write)) .def("write", py::overload_cast<const std::string&, int32_t>(&FileOutput::write)) .def("write", py::overload_cast<const std::string&, int8_t>(&FileOutput::write)) .def("write", py::overload_cast<const std::string&, const Tensor&>(&FileOutput::write)) .def("write", py::overload_cast<const std::string&, const Variable&>(&FileOutput::write)); }