Skip to content

Commit ee0b75a

Browse files
Ir1dsoumith
authored andcommitted
docs: Add warning to torch.repeat() (#8116)
* docs: Add warning to torch.repeat() closes #7993 * docs: Add links for numpy functions * docs: Break the too long line
1 parent f5cd479 commit ee0b75a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

torch/_tensor_docs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,13 @@ def callable(a, b) -> number
15581558
15591559
Unlike :meth:`~Tensor.expand`, this function copies the tensor's data.
15601560
1561+
.. warning::
1562+
1563+
:func:`torch.repeat` behaves differently from
1564+
`numpy.repeat <https://docs.scipy.org/doc/numpy/reference/generated/numpy.repeat.html>`_,
1565+
but is more similar to
1566+
`numpy.tile <https://docs.scipy.org/doc/numpy/reference/generated/numpy.tile.html>`_.
1567+
15611568
Args:
15621569
sizes (torch.Size or int...): The number of times to repeat this tensor along each
15631570
dimension

0 commit comments

Comments
 (0)