參數(shù)說明:index_select(x, 1, indices) 1代表維度1,即列,indices是篩選的索引序號(hào)。 例子: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 importtorch x=torch.linspace(1,12, steps=12).view(3,4) print(x) indices=torch.LongTensor([0,2]) ...
www.dbjr.com.cn/article/1679...htm 2025-5-19