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

username: Nazila-H
cooked: <p>Hi everybody,<br>
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:</p>
<p>Server side:</p>
<pre><code class="lang-auto">from syft.workers.websocket_client import WebsocketClientWorker

alice = WebsocketClientWorker( related arguments)

print(type(alice))
x = torch.tensor([1,3,5])
x_ptr = x.send(alice)
print(x_ptr)
print(x)
</code></pre>
<p>Client side:</p>
<pre><code class="lang-auto">from syft.workers import websocket_server


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

</code></pre>
<p>after running from client side then server side I got the following results from server side:</p>
<p>&lt;class ‘syft.workers.websocket_client.WebsocketClientWorker’&gt;<br>
(Wrapper)&gt;[PointerTensor | me:56794581876 -&gt; Alice:90382785850]<br>
tensor([1, 3, 5])</p>
<p>then from client side I did not get anything before I stopped execution which I got:</p>
<p>server.list_objects(): {90382785850: tensor([1, 3, 5])}</p>
<p>I want to have the tensor in client side I know <code>syft.workers.websocket_server.</code> <code>WebsocketServerWorker</code> has <code>_recv_msg</code> function but I do not know haw I can use it.</p>
<p>Thank you in advance.</p>

username: mrshenli
cooked: <p>Hey <a class="mention" href="/u/nazila-h">@Nazila-H</a>, is data privacy and security a hard requirement?</p>
<p>If no, <code>torch.distributed.rpc</code> is also an option.</p>
<ul>
<li>API: <a href="https://pytorch.org/docs/master/rpc.html" rel="noopener nofollow ugc">https://pytorch.org/docs/master/rpc.html</a>
</li>
<li>tutorial: <a href="https://pytorch.org/tutorials/beginner/dist_overview.html" rel="noopener nofollow ugc">https://pytorch.org/tutorials/beginner/dist_overview.html</a>
</li>
</ul>
<p>If yes, we will need some help from the PySyft experts.</p>
<p><a class="mention" href="/u/ptrblck">@ptrblck</a> do you know who is familiar with PySyft? Thx!</p>

username: ptrblck
cooked: <p><a class="mention" href="/u/tudor_cebere">@Tudor_Cebere</a> is currently working on <code>PySyft</code>, if I’m not mistaken, so he might help. <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>

username: Tudor_Cebere
cooked: <p>Thank you <a class="mention" href="/u/ptrblck">@ptrblck</a> for pointing out this issue!</p>
<p>Hello <a class="mention" href="/u/nazila-h">@Nazila-H</a>,</p>
<p>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:</p>
<ul>
<li>Joining the OpenMined slack and asking questions there, you will really fast responses.</li>
<li>Try the new 0.3.0 version.</li>
</ul>
<p>If 0.2.X is a hard requirement, please create an issue here:</p>
<p><a href="https://github.com/OpenMined/PySyft" rel="noopener nofollow ugc">PySyft</a></p>
<p>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.</p>
<p>Thank you,<br>
Tudor Cebere</p>

username: Nazila-H
cooked: <p>Hey <a class="mention" href="/u/mrshenli">@mrshenli</a>, thank you for your answer.<br>
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.</p>

username: Nazila-H
cooked: <p>Thank you <a class="mention" href="/u/ptrblck">@ptrblck</a> <img src="https://discuss.pytorch.org/images/emoji/apple/slightly_smiling_face.png?v=9" title=":slightly_smiling_face:" class="emoji" alt=":slightly_smiling_face:">.</p>

username: Nazila-H
cooked: <p>Hello <a class="mention" href="/u/tudor_cebere">@Tudor_Cebere</a>.<br>
Thank you for your explanation.<br>
Yes, I am working with syft v.02.<br>
I will ask my question in OpenMined slack.</p>
<p>Best,<br>
Nazila</p>