PySyft icon indicating copy to clipboard operation
PySyft copied to clipboard

Indexing pointer tensors with a list

Open artix41 opened this issue 6 years ago • 1 comments

When running the following code

hook = sy.TorchHook(torch)
bob = sy.VirtualWorker(hook, id="bob")

a = torch.tensor([10,20,30])
print(a[[0,2]])

b = torch.tensor([10,20,30]).send(bob)
print(b[[0,2]])

the first tensor a get displayed correctly as

tensor([10, 30])

but the second tensor raises the following error:

IndexError: too many indices for tensor of dimension 1

I have Python 3.7.6, PySyft 0.2.4 and PyTorch 1.4.0.

I'm new to PySyft, so maybe it is an expected behavior for some reasons, but I don't really see why (since remote tensors are supposed to have the same functionalities as normal tensors as far as I understand).

artix41 avatar Mar 27 '20 12:03 artix41

I can take a look.

rotalex avatar Mar 27 '20 21:03 rotalex