SIGN IN SIGN UP

Dtype compliance: clamp (#83)

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

Reland of D47573238 (Adjusting clamp portable op have near-complete Dtype compliance with aten version), but with the supernova build fixed.

In the original diff, we were doing something like:
```
if isFloatingType(out_type)
     assert (double(min_val) >= out_type_min_value)
```

One problem with this is that if out_type is ```long```, then this comparison causes the long min value to be converted to double, which is unsafe. Even though it's impossible for this to happen when running the code due to the if statement, the compiler isn't smart enough to know that, so it was giving errors.

The fix is to wrap these checks within ET_SWITCH_INT_TYPES or ET_SWITCH_FLOAT_TYPES macros within the if statements

Reviewed By: SS-JIA

Differential Revision: D48491102

fbshipit-source-id: 37dfe0a5a1e15f3e83bbd5e65a4ad1ae56b19535
S
Salil Desai committed
2b85bcbd0fae293a34d42016ce79ddecc3659f06
Parent: 1f903c4
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 8/23/2023, 9:12:13 PM