I have a pair of value - index tensors.

```
value = torch.rand(2, 128, 10, 10) # (batch, feature_size, x, y)
indices = torch.randint_like(torch.zeros(2, 30, 2), min=0, max=9) # (batch, n_sample, xy)
```

The expected shape of output tensor is like below,

```
res: torch.Size([2, 128, 30]) # (batch, feature_size, n_sample)
```

This operation means sampling 30 points among the 10x10 = 100 plane.

I tried to use **index_select**, but it only works with index tensor of 1-D.

I have an option that create a bool tensor having size of (2, 10, 10) and use **masked_select**.

However, it is ineffective as the number of samples increase.

I need your help

Thanks