Skip to content

Commit 46ee1e4

Browse files
gchanansoumith
authored andcommitted
Clarify definition of gather function in docs. (pytorch#1652)
1 parent 036c3f9 commit 46ee1e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

torch/_torch_docs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,9 +1397,9 @@
13971397
13981398
For a 3-D tensor the output is specified by::
13991399
1400-
out[i][j][k] = input[index[i][j][k]][j][k] # dim=0
1401-
out[i][j][k] = input[i][index[i][j][k]][k] # dim=1
1402-
out[i][j][k] = input[i][j][index[i][j][k]] # dim=2
1400+
out[i][j][k] = input[index[i][j][k]][j][k] # if dim == 0
1401+
out[i][j][k] = input[i][index[i][j][k]][k] # if dim == 1
1402+
out[i][j][k] = input[i][j][index[i][j][k]] # if dim == 2
14031403
14041404
If :attr:`input` is an n-dimensional tensor with size
14051405
:math:`(x_0, x_1..., x_{i-1}, x_i, x_{i+1}, ..., x_{n-1})`

0 commit comments

Comments
 (0)