Skip to content

Commit 98b4db5

Browse files
committed
Remove return_value_policy
1 parent 4aa020b commit 98b4db5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/wrapper.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ PYBIND11_MODULE(seal, m)
144144
.def("nonzero_coeff_count", &Plaintext::nonzero_coeff_count)
145145
.def("to_string", &Plaintext::to_string)
146146
.def("is_ntt_form", &Plaintext::is_ntt_form)
147-
.def("parms_id", py::overload_cast<>(&Plaintext::parms_id, py::const_), py::return_value_policy::reference)
148-
.def("scale", py::overload_cast<>(&Plaintext::scale, py::const_), py::return_value_policy::reference)
147+
.def("parms_id", py::overload_cast<>(&Plaintext::parms_id, py::const_))
148+
.def("scale", py::overload_cast<>(&Plaintext::scale, py::const_))
149149
.def("scale", [](Plaintext &plain, double scale){
150150
plain.scale() = scale;
151151
})
@@ -176,8 +176,8 @@ PYBIND11_MODULE(seal, m)
176176
.def("size_capacity", &Ciphertext::size_capacity)
177177
.def("is_transparent", &Ciphertext::is_transparent)
178178
.def("is_ntt_form", py::overload_cast<>(&Ciphertext::is_ntt_form, py::const_))
179-
.def("parms_id", py::overload_cast<>(&Ciphertext::parms_id, py::const_), py::return_value_policy::reference)
180-
.def("scale", py::overload_cast<>(&Ciphertext::scale, py::const_), py::return_value_policy::reference)
179+
.def("parms_id", py::overload_cast<>(&Ciphertext::parms_id, py::const_))
180+
.def("scale", py::overload_cast<>(&Ciphertext::scale, py::const_))
181181
.def("scale", [](Ciphertext &cipher, double scale){
182182
cipher.scale() = scale;
183183
})
@@ -199,7 +199,7 @@ PYBIND11_MODULE(seal, m)
199199
py::class_<SecretKey>(m, "SecretKey")
200200
.def(py::init<>())
201201
.def(py::init<const SecretKey &>())
202-
.def("parms_id", py::overload_cast<>(&SecretKey::parms_id, py::const_), py::return_value_policy::reference)
202+
.def("parms_id", py::overload_cast<>(&SecretKey::parms_id, py::const_))
203203
.def("save", [](const SecretKey &sk, const std::string &path){
204204
std::ofstream out(path, std::ofstream::binary);
205205
sk.save(out);
@@ -215,7 +215,7 @@ PYBIND11_MODULE(seal, m)
215215
py::class_<PublicKey>(m, "PublicKey")
216216
.def(py::init<>())
217217
.def(py::init<const PublicKey &>())
218-
.def("parms_id", py::overload_cast<>(&PublicKey::parms_id, py::const_), py::return_value_policy::reference)
218+
.def("parms_id", py::overload_cast<>(&PublicKey::parms_id, py::const_))
219219
.def("save", [](const PublicKey &pk, const std::string &path){
220220
std::ofstream out(path, std::ofstream::binary);
221221
pk.save(out);
@@ -232,7 +232,7 @@ PYBIND11_MODULE(seal, m)
232232
.def(py::init<>())
233233
.def(py::init<const KSwitchKeys &>())
234234
.def("size", &KSwitchKeys::size)
235-
.def("parms_id", py::overload_cast<>(&KSwitchKeys::parms_id, py::const_), py::return_value_policy::reference)
235+
.def("parms_id", py::overload_cast<>(&KSwitchKeys::parms_id, py::const_))
236236
.def("save", [](const KSwitchKeys &ksk, const std::string &path){
237237
std::ofstream out(path, std::ofstream::binary);
238238
ksk.save(out);
@@ -249,7 +249,7 @@ PYBIND11_MODULE(seal, m)
249249
.def(py::init<>())
250250
.def(py::init<const RelinKeys::KSwitchKeys &>())
251251
.def("size", &RelinKeys::KSwitchKeys::size)
252-
.def("parms_id", py::overload_cast<>(&RelinKeys::KSwitchKeys::parms_id, py::const_), py::return_value_policy::reference)
252+
.def("parms_id", py::overload_cast<>(&RelinKeys::KSwitchKeys::parms_id, py::const_))
253253
.def_static("get_index", &RelinKeys::get_index)
254254
.def("has_key", &RelinKeys::has_key)
255255
.def("save", [](const RelinKeys &rk, const std::string &path){
@@ -268,7 +268,7 @@ PYBIND11_MODULE(seal, m)
268268
.def(py::init<>())
269269
.def(py::init<const GaloisKeys::KSwitchKeys &>())
270270
.def("size", &GaloisKeys::KSwitchKeys::size)
271-
.def("parms_id", py::overload_cast<>(&GaloisKeys::KSwitchKeys::parms_id, py::const_), py::return_value_policy::reference)
271+
.def("parms_id", py::overload_cast<>(&GaloisKeys::KSwitchKeys::parms_id, py::const_))
272272
.def_static("get_index", &GaloisKeys::get_index)
273273
.def("has_key", &GaloisKeys::has_key)
274274
.def("save", [](const GaloisKeys &gk, const std::string &path){
@@ -286,7 +286,7 @@ PYBIND11_MODULE(seal, m)
286286
py::class_<KeyGenerator>(m, "KeyGenerator")
287287
.def(py::init<const SEALContext &>())
288288
.def(py::init<const SEALContext &, const SecretKey &>())
289-
.def("secret_key", &KeyGenerator::secret_key, py::return_value_policy::reference)
289+
.def("secret_key", &KeyGenerator::secret_key)
290290
.def("create_public_key", py::overload_cast<PublicKey &>(&KeyGenerator::create_public_key, py::const_))
291291
.def("create_relin_keys", py::overload_cast<RelinKeys &>(&KeyGenerator::create_relin_keys))
292292
.def("create_galois_keys", py::overload_cast<const std::vector<int> &, GaloisKeys &>(&KeyGenerator::create_galois_keys))

0 commit comments

Comments
 (0)