How can I receive a tensor from server side and continue computations in client side?

Hi everybody,
I want to send a tensor from a server side to a client side and receive it then start to do some computations there. I have defined worker and server as following:

Server side:

from syft.workers.websocket_client import WebsocketClientWorker

alice = WebsocketClientWorker( related arguments)

x = torch.tensor([1,3,5])
x_ptr = x.send(alice)

Client side:

from syft.workers import websocket_server

server = websocket_server.WebsocketServerWorker( id=id, host=host, port=port, hook=hook, verbose=verbose)
print('server.list_objects():', server.list_objects())

after running from client side then server side I got the following results from server side:

<class ‘syft.workers.websocket_client.WebsocketClientWorker’>
(Wrapper)>[PointerTensor | me:56794581876 -> Alice:90382785850]
tensor([1, 3, 5])

then from client side I did not get anything before I stopped execution which I got:

server.list_objects(): {90382785850: tensor([1, 3, 5])}

I want to have the tensor in client side I know syft.workers.websocket_server. WebsocketServerWorker has _recv_msg function but I do not know haw I can use it.

Thank you in advance.

1 Like

Hey @Nazila-H, is data privacy and security a hard requirement?

If no, torch.distributed.rpc is also an option.

If yes, we will need some help from the PySyft experts.

@ptrblck do you know who is familiar with PySyft? Thx!

1 Like

@Tudor_Cebere is currently working on PySyft, if I’m not mistaken, so he might help. :slight_smile:


Thank you @ptrblck for pointing out this issue!

Hello @Nazila-H,

As a small disclaimer, you are using syft_0.2.X, which currently is not under active development. If you want to get familiar with the syft ecosystem I would recommend:

  • Joining the OpenMined slack and asking questions there, you will really fast responses.
  • Try the new 0.3.0 version.

If 0.2.X is a hard requirement, please create an issue here:


And add the 0.2.X tag, the community/people that are still working to fix issues on 0.2.X will help you as soon as possible.

Thank you,
Tudor Cebere


Hey @mrshenli, thank you for your answer.
Yes, I need to preserve the privacy so I am working with PySyft 0.2.4 and it seems my problems are because of the version.

Thank you @ptrblck :slightly_smiling_face:.

Hello @Tudor_Cebere.
Thank you for your explanation.
Yes, I am working with syft v.02.
I will ask my question in OpenMined slack.