Describe the bug
Pailier Tensor has serde methods (simplify/detail), but no testing done. I've added a dummy test in test/serde/serde_helpers.py, make_pailier, but no proper testing.
Expected behavior
Proper testing for Pailier tensor.
Hello!
I would like to work on this.
See #3478 for some additional details.
Hello!
I would like to work on this.
Hi @doringeman ! Where you able to create the tests? I found out that simplify and detail in the PaillierTensor class do not work when the tensor has elements inside. Therefore I have not been able to create the proper tests. Check this code:
from syft.frameworks.torch.tensors.interpreters.paillier import PaillierTensor
import syft as sy
hook = sy.TorchHook(torch)
bob = sy.VirtualWorker(hook, id="bob")
array0 = np.array([]) # 0 dimension array
array1 = np.array([1,4]) # 1 dimension array
array2 = np.array([[5,2,3],[1,4,4],[2,4,4],[2,4,4]]) # 3 or n dimension array
x_tensor0 = torch.Tensor(array0)
x_tensor1 = torch.Tensor(array1)
x_tensor2 = torch.Tensor(array2)
pub, pri = sy.keygen()
x_encrypted0 = x_tensor0.encrypt(protocol="paillier", public_key=pub)
x_encrypted1 = x_tensor1.encrypt(protocol="paillier", public_key=pub)
x_encrypted2 = x_tensor2.encrypt(protocol="paillier", public_key=pub)
simplified0 = PaillierTensor.simplify(worker=bob, tensor=x_encrypted0)
simplified1 = PaillierTensor.simplify(worker=bob, tensor=x_encrypted1)
simplified2 = PaillierTensor.simplify(worker=bob, tensor=x_encrypted2)
detailed0 = PaillierTensor.detail(worker=bob, tensor_tuple=simplified0)
# error here: ValueError: cannot create an OBJECT array from memory buffer
detailed1 = PaillierTensor.detail(worker=bob, tensor_tuple=simplified1)
detailed2 = PaillierTensor.detail(worker=bob, tensor_tuple=simplified2)
Let me know if you were able to solve it. You can contact me in slack as well :)
Hello, @NicoSerranoP
Unfortunately, not yet. You can set it to available if you want to.
@karlhigley @tudorcebere I think I solved this issue. I am just running the tests and will do a pull request tomorrow :)
This issue has been marked stale because it has been open 30 days with no activity. Leave a comment or remove the stale label to unmark it. Otherwise, this will be closed in 7 days.
Most helpful comment
Hello!
I would like to work on this.