In torch slicing creates a View i.e. the data is not copied into a new tensor i.e. it acts as ALIAS
b = a[3:10, 2:5 ]
My understanding is that is not the case for indexed slice. f.e.
b = a[[1,2,3] : [5,11]]
Is this correct ?
And second is there a module that mimic a view i.e. internally holds the indexes but access the original tensor i.e. act as a sort of proxy ?
Something like this, but more general :
class IXView:
def __init__(self, ixs, ten):
self.ixs = ixs
self.ten = ten
def __getitem__(self, rows) :
return self.ten[self.ixs[rows],:]