PySyft icon indicating copy to clipboard operation
PySyft copied to clipboard

Add size() method for remote tensors

Open DanyEle opened this issue 7 years ago • 5 comments

The last remaining method that we would need to get the forward pass into remote LSTMs is the implementation of the size() method for remote tensors, as described in Pull Request #2160.

DanyEle avatar May 31 '19 07:05 DanyEle

This will be complicated as is, because .size() is used in many places to get informations about the current object and not to what it's pointing at. (like torch.save())

Namely we would like to have t.size() == torch.Size([0]) for t = torch.tensor([1, 2, 3, 4]).send(bob) while .shape is used to look at the target object so t.shape == torch.Size([4])

LaRiffle avatar May 31 '19 13:05 LaRiffle

@robert-wagner I'd love to have your view on this point (namely we have a method which could apply for the pointer object AND the point target)

LaRiffle avatar May 31 '19 13:05 LaRiffle

@robert-wagner I'd love to have your view on this point (namely we have a method which could apply for the pointer object AND the point target)

Sorry for the delay in getting back to you on this. I need to adjust my notification preferences for GitHub (I currently get way to many messages to deal with)

My question is why does the size of the pointer matter (what utility do we get out of it? I can definitely see the case for getting the size of the object that it is pointing to but I am not sure what the point of getting the size of the pointer is (other than knowing it is a pointer but in many cases there are better ways to do that)

robert-wagner avatar Jun 04 '19 20:06 robert-wagner

It is used internally when you're printing Tensors objects for example, so hooking .size() might (and does) break many processes

LaRiffle avatar Jun 06 '19 22:06 LaRiffle

I'm closing this since I don't see obvious way of fixing this.

LaRiffle avatar Aug 23 '19 06:08 LaRiffle