Conversation
The attach loop ran in both MIAHandler.__init__ and LeakPro.setup_handler. On the MIA path the two were identical, binding AbstractInputHandler methods twice per run. Keep the single central loop in setup_handler (the only attach point for both MIA and MINV paths) and drop the duplicate from __init__. Also drops the now-unused training_handler parameter and inspect/types imports in mia_handler.py, and updates the single internal call site in leakpro.py. Fixes aidotse#394
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes the duplicated method-attachment loop that ran in both
MIAHandler.__init__andLeakPro.setup_handler(#394). On the MIA path the two loops were identical, soAbstractInputHandlermethods were bound to the handler twice on every run.The loop is kept in
LeakPro.setup_handler— the single point that attaches methods for both the MIA and MINV paths. The other direction, removing it fromsetup_handler, was rejected:MINVHandler.__init__only receivesconfigsand has no access to the training handler, so it would require a signature change there (as the issue notes).MIAHandler.__init__training_handlerparameter and the now-unusedinspect/typesimports inmia_handler.py.MIAHandleris constructed only internally byLeakPro.setup_handler; it is not re-exported in any__all__and not shown in docs/notebooks.leakpro.pyResolved Issues
How Has This Been Tested?
ruff checkpasses locally on the changed files. I couldn't run the pytest suite locally (torch isn't installed in my environment), so I'm relying on CI there. The change is covered:test_tabular_input_handlerbuilds the handler throughLeakPro(...)→setup_handlerand callshandler.train(...), so method attachment is exercised end-to-end andsetup_handlerbinds the same methods as before.Related Pull Requests
(none)