-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Support clamp() with tensor min and max #2793
Copy link
Copy link
Closed
Labels
function requestA request for a new function or the addition of new arguments/modes to an existing function.A request for a new function or the addition of new arguments/modes to an existing function.good first issuehigh prioritymodule: numpyRelated to numpy support, and also numpy compatibility of our operatorsRelated 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 moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
It might be useful to extend the current clamp() function, where the min and max can be tensor.
e.g. To clip the value for a [5, 3]-tensor, we could define min and max for each element, or each row/column.
Finally, it might be good to rename it to clip to be consistent with numpy.clip
cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser @mruberry @rgommers @heitorschueroff
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
function requestA request for a new function or the addition of new arguments/modes to an existing function.A request for a new function or the addition of new arguments/modes to an existing function.good first issuehigh prioritymodule: numpyRelated to numpy support, and also numpy compatibility of our operatorsRelated 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 moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module