Made cpp proximal decoder pickling compile

This commit is contained in:
Andreas Tsouchlos 2022-12-01 01:26:26 +01:00
parent 7c6962bf65
commit 0705fbbcaf
2 changed files with 9 additions and 7 deletions

View File

@ -106,7 +106,7 @@ public:
* @return \b std::tuple
*/
auto get_decoder_state() const {
return std::tuple(mK, mOmega, mGamma, mEta, mH);
return std::tuple(mH, mK, mOmega, mGamma, mEta);
}
private:

View File

@ -17,12 +17,14 @@ using namespace pybind11::literals;
.def("decode", &ProximalDecoder<m, n>::decode, "x"_a.noconvert()) \
.def(py::pickle( \
[](const ProximalDecoder<m, n>& a) { \
MatrixiR<m, n> H; \
int K; \
double omega; \
double gamma; \
double eta; \
std::tie(H, K, omega, gamma, eta) = a.get_decoder_state(); \
auto state = a.get_decoder_state(); \
\
MatrixiR<m, n> H = std::get<0>(state); \
int K = std::get<1>(state); \
double omega = std::get<2>(state); \
double gamma = std::get<3>(state); \
double eta = std::get<4>(state); \
\
return py::make_tuple(H, K, omega, gamma, eta); \
}, \
[](py::tuple t) { \