-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Open
Labels
module: deprecationmodule: numpyRelated to numpy support, and also numpy compatibility of our operatorsRelated to numpy support, and also numpy compatibility of our operatorsmodule: python array apiIssues related to the Python Array APIIssues related to the Python Array APImodule: reductionsneeds designWe want to add this feature but we need to figure out how firstWe want to add this feature but we need to figure out how firsttriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
torch.min, torch.max, torch.median and torch.mode return indices along with the values when reducing over one dimension. This is incompatible with the Python Array API Standard as described in the following issue #58745 and furthermore makes it difficult to support reducing over multiple dimensions.
Alternatives
- a dedicated operator for computing the extra output such as
argmaxthat only returns that extra output - a variant of the function, e.g.
argmax_with_indices, that returns all output tensors - an optional parameter
return_indices=Trueto explicitly ask for the extra output, although it is discouraged to have operators with multiple possible return types - an optional out parameter on which to place the extra output, this avoids the return type changing and creating a combinatorial number of variants of the operator. We already support the out= keyword so it might be possible to extend the code to accept extra optional out tensors.
cc @mruberry @rgommers @heitorschueroff @pmeier @asmeurer @leofang @AnirudhDagar @asi1024 @emcastillo @kmaehashi
narain1, nlgranger, mruberry, thomasahle, Maykeye and 2 more
Metadata
Metadata
Assignees
Labels
module: deprecationmodule: numpyRelated to numpy support, and also numpy compatibility of our operatorsRelated to numpy support, and also numpy compatibility of our operatorsmodule: python array apiIssues related to the Python Array APIIssues related to the Python Array APImodule: reductionsneeds designWe want to add this feature but we need to figure out how firstWe want to add this feature but we need to figure out how firsttriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module