@@ -144,8 +144,8 @@ PYBIND11_MODULE(seal, m)
144
144
.def (" nonzero_coeff_count" , &Plaintext::nonzero_coeff_count)
145
145
.def (" to_string" , &Plaintext::to_string)
146
146
.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_))
149
149
.def (" scale" , [](Plaintext &plain, double scale){
150
150
plain.scale () = scale;
151
151
})
@@ -176,8 +176,8 @@ PYBIND11_MODULE(seal, m)
176
176
.def (" size_capacity" , &Ciphertext::size_capacity)
177
177
.def (" is_transparent" , &Ciphertext::is_transparent)
178
178
.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_))
181
181
.def (" scale" , [](Ciphertext &cipher, double scale){
182
182
cipher.scale () = scale;
183
183
})
@@ -199,7 +199,7 @@ PYBIND11_MODULE(seal, m)
199
199
py::class_<SecretKey>(m, " SecretKey" )
200
200
.def (py::init<>())
201
201
.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_))
203
203
.def (" save" , [](const SecretKey &sk, const std::string &path){
204
204
std::ofstream out (path, std::ofstream::binary);
205
205
sk.save (out);
@@ -215,7 +215,7 @@ PYBIND11_MODULE(seal, m)
215
215
py::class_<PublicKey>(m, " PublicKey" )
216
216
.def (py::init<>())
217
217
.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_))
219
219
.def (" save" , [](const PublicKey &pk, const std::string &path){
220
220
std::ofstream out (path, std::ofstream::binary);
221
221
pk.save (out);
@@ -232,7 +232,7 @@ PYBIND11_MODULE(seal, m)
232
232
.def (py::init<>())
233
233
.def (py::init<const KSwitchKeys &>())
234
234
.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_))
236
236
.def (" save" , [](const KSwitchKeys &ksk, const std::string &path){
237
237
std::ofstream out (path, std::ofstream::binary);
238
238
ksk.save (out);
@@ -249,7 +249,7 @@ PYBIND11_MODULE(seal, m)
249
249
.def (py::init<>())
250
250
.def (py::init<const RelinKeys::KSwitchKeys &>())
251
251
.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_))
253
253
.def_static (" get_index" , &RelinKeys::get_index)
254
254
.def (" has_key" , &RelinKeys::has_key)
255
255
.def (" save" , [](const RelinKeys &rk, const std::string &path){
@@ -268,7 +268,7 @@ PYBIND11_MODULE(seal, m)
268
268
.def (py::init<>())
269
269
.def (py::init<const GaloisKeys::KSwitchKeys &>())
270
270
.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_))
272
272
.def_static (" get_index" , &GaloisKeys::get_index)
273
273
.def (" has_key" , &GaloisKeys::has_key)
274
274
.def (" save" , [](const GaloisKeys &gk, const std::string &path){
@@ -286,7 +286,7 @@ PYBIND11_MODULE(seal, m)
286
286
py::class_<KeyGenerator>(m, " KeyGenerator" )
287
287
.def (py::init<const SEALContext &>())
288
288
.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)
290
290
.def (" create_public_key" , py::overload_cast<PublicKey &>(&KeyGenerator::create_public_key, py::const_))
291
291
.def (" create_relin_keys" , py::overload_cast<RelinKeys &>(&KeyGenerator::create_relin_keys))
292
292
.def (" create_galois_keys" , py::overload_cast<const std::vector<int > &, GaloisKeys &>(&KeyGenerator::create_galois_keys))
0 commit comments