I populate a tensor with dimensions that are not fixed. Then, I try to index this tensor. I would like to pass the indices as a list, but that doesn’t seem to work.
A = torch.rand((5,5,4,18)) B = [3,3,2]
Instead of indexing it as
why can’t I do
I need this because in my case the dimensions of B keep changing.