SIGN IN SIGN UP

Dtype compliance: clamp (#69)

Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/69

Adjust clamp portable op have near-complete Dtype compliance with aten version.

The Aten version of clamp has a weird quirk where it allows you to pass in a value for the min and/or max args which is below the normal range of the input/output tensor dataype when that datatype is uint8 specifically. But it doesn't allow ABOVE the range, and it doesn't allow below or above for any other datatype. We are choosing to leave a discrepancy between aten and portable by making uint8 behave like the rest of the datatypes for portable (not allowing below the range). This is already tested by the ByteTensorNegativeClampDies test (which is skipped when running the aten tests).

Reviewed By: SS-JIA, manuelcandales

Differential Revision: D47573238

fbshipit-source-id: c083d810365e1b7dea46169e826292dd1daa29d9
S
Salil Desai committed
128c27aee437b3f5674df98b4d62688d5e4cd6eb
Parent: 23cfcaa
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 8/17/2023, 6:35:57 PM