Pysyft: Sending private tensors throws and error when only one user is listed in "allowed_users"

Created on 1 Oct 2020  路  8Comments  路  Source: OpenMined/PySyft

Description

After creating a private tensor, I get a SendNotPermittedError when trying to send the data to the node if only one user is listed in allowed_users.

How to Reproduce

private_dataset = th.tensor([1, 3.5, 47.3]).private_tensor(allowed_users = ("Alice")) private_dataset = private_dataset.tag('#my_data') data_pointer = private_dataset.send(site, user='Alice')

Expected Behavior

Possibility to define only one allowed user.

Additional Context

To overcome this issue I am currently listing the same user twice. For instance, allowed_users = ("Alice", "Alice")

Good first issue Type hacktoberfest

All 8 comments

Thank you for reporting this :+1:

I will take this one.

:raised_hands:

actually this not a bug, private tensor expects a list of users, private_tensor(allowed_users = ("Alice")) and here you are passing a string basically which converts to 5 users ['A', 'l' ....],

either pass a list or tuple. for tuple with single element you need to use this format ("Alice",) , ("Alice") this is just a string
private_tensor(allowed_users = ("Alice",)) this will work
or better private_tensor(allowed_users = ["Alice"])

Thank you for looking into this. I think we can close it!

@gmuraru should i add a method to convert string to list explicitly?
so you can pass a string also, and passing string for single user looks better

Nope, I think it is fine because the parameter name allowed_users allude to a list/tuple of user names

cool np

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samsontmr picture samsontmr  路  3Comments

alberduris picture alberduris  路  3Comments

tblazina picture tblazina  路  3Comments

wentaiwu92 picture wentaiwu92  路  4Comments

s-marta picture s-marta  路  4Comments