Fix: Extract some methods from FCLayers for easier inheritance#3880
Merged
ori-kron-wis merged 3 commits intoJun 30, 2026
Merged
Conversation
Add _build_layer, _is_linear_layer, _apply_batch_norm, and _apply_layer as overridable hooks so subclasses (e.g. SplitFCLayers in DRVI) can customise layer construction and dispatch without duplicating the forward loop. Store constructor args as instance attributes so _build_layer can reference them. Also fix set_online_update_hooks to use [...] instead of [:, ...] so the gradient mask works on 3-D weight tensors (injected-covariate case with sampling). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merged
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3880 +/- ##
=======================================
Coverage 88.54% 88.54%
=======================================
Files 231 231
Lines 23050 23064 +14
=======================================
+ Hits 20409 20423 +14
Misses 2641 2641
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Add _build_layer, _is_linear_layer, _apply_batch_norm, and _apply_layer as overridable hooks so subclasses (e.g. SplitFCLayers in DRVI) can customise layer construction and dispatch without duplicating the forward loop and scArches logic. Store constructor args as instance attributes so _build_layer can reference them.
Also, fix set_online_update_hooks to use [..., dims_to_update] instead of [:, dims_to_update] so the gradient mask works on 3-D weight tensors (as in DRVI decoder).