+void PredictorWrapper::dump()
+{
+ LOG_DEBUG(TAG, "dump");
+ cout << "dump" << endl;
+ std::string ss = "";
+ try{
+ cout << "==== before" << endl;
+ py::object ret = this->dump_func();
+ ss = py::extract<std::string>(ret);
+ } catch (boost::python::error_already_set const &){
+ std::string perror_str = parse_python_exception();
+ LOG_ERROR(TAG, "Error in Python: " + perror_str)
+ }
+ LOG_DEBUG(TAG, ss);
+}
+
+double PredictorWrapper::predict(int index, const std::vector<double>& ff)
+{
+ LOG_DEBUG(TAG, "predict");
+ py::object ret;
+ try{
+ ret = this->predict_func(index, toPythonList(ff));
+ } catch (boost::python::error_already_set const &){
+ std::string perror_str = parse_python_exception();
+ LOG_ERROR(TAG, "Error in Python: " + perror_str)
+ }
+ double rr = py::extract<double>(ret);
+ LOG_DEBUG(TAG, "return: " + std::to_string(rr));
+ return rr;
+}
+
+PredictorWrapper::PredictorWrapper(const std::string& py_dir, const std::string& model_path)