Adding tensor methods

This commit is contained in:
2023-11-01 14:13:45 +01:00
parent cb3281ed91
commit 296ed6b785
9 changed files with 144 additions and 112 deletions

View File

@@ -1,4 +1,5 @@
#include "PyClassifier.h"
#include <torch/csrc/autograd/python_variable.h>
namespace pywrap {
@@ -13,13 +14,21 @@ namespace pywrap {
pyWrap->clean(module, className);
}
std::string PyClassifier::callMethod(const std::string& method)
std::string PyClassifier::version()
{
return pyWrap->version(module, className);
}
std::string PyClassifier::callMethodString(const std::string& method)
{
return pyWrap->callMethodString(module, className, method);
}
PyClassifier& PyClassifier::fit(torch::Tensor& X, torch::Tensor& y, const std::vector<std::string>& features, const std::string& className, std::map<std::string, std::vector<int>>& states)
{
PyObject* Xp = NULL;//THPVariable_Wrap(X);
PyObject* yp = NULL;//THPVariable_Wrap(y);
pyWrap->fit(module, className, Xp, yp);
return *this;
}
} /* namespace PyWrap */