Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(metrics): Fix BinaryAccuracy metric to handle boolean inputs (#20782
) * Fix BinaryAccuracy metric to handle boolean inputs Previously, BinaryAccuracy would return incorrect results when given boolean inputs in JAX backend, and would raise errors in TensorFlow backend. This was because the metric expects numerical values (floats/integers) but wasn't properly handling boolean array inputs. Fix by casting y_true and y_pred to floatx() in MeanMetricWrapper.update_state(). This ensures consistent behavior across backends and proper handling of boolean inputs. * fix: Make the linter happy :) * fix: Align update_state casting with metric's data type
- Loading branch information