遇到问题:
列表中的索引为一个列表
记录代入具体值试验的结果
example_1
points = torch.rand((5, 4, 3))
b_idx = torch.randint(4, (5, 2))
idx = torch.randint(4, (5, 2))
new = points[b_idx, idx, :]
points:
>>>
tensor([[[5.9856e-01, 8.5678e-01, 9.8524e-01],
[7.0864e-01, 7.1617e-01, 1.3145e-01],
[1.3583e-01, 8.8172e-01, 1.0228e-01],
[3.9284e-01, 5.1706e-01, 6.1809e-01]],
[[7.0592e-01, 7.1845e-01, 9.4552e-01],
[9.6846e-01, 8.6515e-01, 4.9927e-01],
[8.3103e-01, 1.8320e-01, 5.3334e-01],
[7.9671e-01, 9.9947e-01, 8.3414e-01]],
[[5.1316e-01, 5.4100e-02, 9.3235e-01],
[9.0255e-01, 4.5346e-01, 1.7189e-01],
[8.1241e-01, 4.8314e-02, 5.3953e-01],
[5.7105e-01, 1.1216e-01, 6.8769e-01]],
[[4.5663e-01, 5.9473e-02, 7.5409e-01],
[8.0928e-01, 3.8738e-01, 2.6865e-01],
[9.4528e-01, 9.5299e-01, 2.9093e-01