Gathers values along an axis specified by dim.
input
and index
must have the same number of dimensions. It is also required that index.size(d) <= input.size(d)
for all dimensions d != dim
. out
will have the same shape as index
. Note that input
and index
do not broadcast against each other.
>>> t = torch.tensor([[1, 2], [3, 4]]) >>> torch.gather(t, 1, torch.tensor([[0, 0], [1, 0]])) tensor([[ 1, 1], [ 4, 3]])
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4