torch.gather torch.gather — PyTorch 1.12 documentation torch.gather torch. gather ( input , dim , index , * , sparse_grad = False , out = None ) → Tensor Gathers values along an axis specified by dim . For a 3-D tensor the output is specified by: out [ i ][ j ][ k ] = input [ index [ i ][ j ][ k ]][ j ][ k ] # if dim == 0 out [ i ][ j ][ k ] = input [ i... pytorch.org tensor 내 특정 위치에 존재하는 값만 따로 뽑아서 쓸 수 있게 도와준다.
바로 이해하기는 힘든 함수이기 때문에 차근차근 노트에 적어가며 공부해보는 것을 추천한다. ※ index 배열 index 배열의 차원의 크기는 input ...
원문 링크 : (pytorch) torch.gather