-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improves robustness of Metrics compatibility checks.
Previously, Metrics used the `.is_compatible()` method inherited from Interpreter, and overloaded it to check compatibility against the LitType spec for the predicted field. This adds a new `.is_field_compatible()` method that takes a required `pred_spec` and an optional `parent_spec` param to check compatibility with the predicted field and its relevant parent types. Calls to `.is_compatible()` for Metrics classes always return `False` to prevent their misuse as Interpreters such as LIME, Integrated Gradients, etc. PiperOrigin-RevId: 462600295
- Loading branch information
1 parent
65c5b8a
commit 0d8341d
Showing
4 changed files
with
187 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.