mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Add docs and test guaranteeing indices from torch.nonzero ordered C-style (#19539)
Summary: See #17556. Pull Request resolved: https://github.com/pytorch/pytorch/pull/19539 Differential Revision: D15030151 Pulled By: ezyang fbshipit-source-id: d46ee56a66d89b0113f86e3f8693dc1680d0adb9
This commit is contained in:
committed by
Facebook Github Bot
parent
3b4d4ef503
commit
f767c9ac76
@ -3459,7 +3459,8 @@ nonzero(input, out=None) -> LongTensor
|
||||
|
||||
Returns a tensor containing the indices of all non-zero elements of
|
||||
:attr:`input`. Each row in the result contains the indices of a non-zero
|
||||
element in :attr:`input`.
|
||||
element in :attr:`input`. The result is sorted lexicographically, with
|
||||
the last index changing the fastest (C-style).
|
||||
|
||||
If :attr:`input` has `n` dimensions, then the resulting indices tensor
|
||||
:attr:`out` is of size :math:`(z \times n)`, where :math:`z` is the total number of
|
||||
|
Reference in New Issue
Block a user