Add size/dimensionality documentation for torch.gather. (#1645)

This commit is contained in:
gchanan
2017-05-24 20:42:18 -04:00
committed by Soumith Chintala
parent e1d257bc6d
commit 9a497f824b

View File

@ -1401,6 +1401,12 @@ For a 3-D tensor the output is specified by::
out[i][j][k] = input[i][index[i][j][k]][k] # dim=1
out[i][j][k] = input[i][j][index[i][j][k]] # dim=2
If :attr:`input` is an n-dimensional tensor with size
:math:`(x_0, x_1..., x_{i-1}, x_i, x_{i+1}, ..., x_{n-1})`
and :attr:`dim` = i, then :attr:`index` must be an n-dimensional tensor with size
:math:`(x_0, x_1, ..., x_{i-1}, y, x_{i+1}, ..., x_{n-1})` where y >= 1 and
:attr:`out` will have the same size as :attr:`index`.
Args:
input (Tensor): The source tensor
dim (int): The axis along which to index