Skip to content

nonzero doesn't squeeze dimension #1834

@vadimkantorov

Description

@vadimkantorov

nonzero isn't consistent with sort in terms of dimensions (though both return an indices vector).

>>> torch.rand(10).nonzero().size()
(10L, 1L)
>>> torch.rand(10).sort()[1].size()
(10L,)

Metadata

Metadata

Assignees

Labels

module: docsRelated to our documentation, both in docs/ and docblocksmodule: numpyRelated to numpy support, and also numpy compatibility of our operatorstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions