lets say i make a tensor
tensor = torch.empty(10,10)

And then lets say i have some logic that fills out 8x8 of that empty space with values.
tensor[0:8,0:8] = 2

is there an easy way to reshape such a tensor into a 8x8 tensor removing all the remaining empty slots.?
And you are not aware of the dimensions of the subspace that has been filled so 8x8 is unknown to you
tensor[0:8,0:8] 

is not a solution