We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c323abc commit 80ebbc8Copy full SHA for 80ebbc8
pybnesian/util/pickle.hpp
@@ -2,19 +2,20 @@
2
#define PYBNESIAN_UTIL_PICKLE_HPP
3
4
#include <pybind11/pybind11.h>
5
+#include <pybind11/stl.h>
6
7
namespace py = pybind11;
8
9
namespace util {
10
11
template <typename OBJ>
-void save_object(const OBJ& factor, std::string name) {
12
+void save_object(const OBJ& obj, std::string name) {
13
auto open = py::module_::import("io").attr("open");
14
15
if (name.size() < 7 || name.substr(name.size() - 7) != ".pickle") name += ".pickle";
16
17
auto file = open(name, "wb");
- py::module_::import("pickle").attr("dump")(py::cast(&factor), file, 2);
18
+ py::module_::import("pickle").attr("dump")(py::cast(&obj), file, 2);
19
file.attr("close")();
20
}
21
0 commit comments