You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix sigmoid operator to support boolean tensor inputs (#13515)
This PR fixes the issue where boolean tensors were rejected by the
`sigmoid` operator in ExecuTorch.
Specifically, it removes the rejection check for boolean tensors in
`op_sigmoid.cpp` and adds proper conversion logic:
* `true` → `1.0` → `sigmoid(1.0) ≈ 0.731059`
* `false` → `0.0` → `sigmoid(0.0) = 0.5`
This resolves the failure reported in **#13492**, where a boolean tensor
with shape `(4, 7, 1, 1, 7, 2)` could not be processed by
`sigmoid.default`.
### Changes
* Removed boolean rejection check in `op_sigmoid.cpp`.
* Added boolean-to-float conversion logic (`true -> 1.0`, `false ->
0.0`) before applying sigmoid.
* Added comprehensive boolean tensor tests in `op_sigmoid_test.cpp`.
### Fixes
Fixes#13492
### Test Plan
* Added new unit tests in `op_sigmoid_test.cpp` to validate behavior
with boolean tensors.
* Verified that boolean tensors now produce correct sigmoid outputs
without rejection.
0 commit comments