Skip to content

refactor: clean up code duplications - #181

Merged
MartinuzziFrancesco merged 6 commits into
mainfrom
fm/cleanup
Sep 18, 2026
Merged

MartinuzziFrancesco merged 6 commits into
mainfrom
fm/cleanup

Conversation

@MartinuzziFrancesco

Copy link
Copy Markdown
Owner

No description provided.

MartinuzziFrancesco and others added 4 commits September 18, 2026 07:33
StackedRNN and FastSlow built their layer/cell lists as untyped
Vector{Any}, grown via push!. Switched both to ntuple(...) do ... end,
matching the pattern already used in RHNCell. Verified gradients still
flow (vector and batched input) and all existing tests pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Every AbstractRecurrentLayer{S} subtype wraps a single `cell` field and
needed a hand-written `functor` override, because Functors.jl's structural
default reconstructs via the bare type name and can't recover the phantom
type parameter S from the cell field alone. All 42 were byte-for-byte the
same mechanical shape modulo the type name, so replaced them with one
generic method in generics.jl dispatching on the abstract type.

Verified fmap/Flux.f64 round-trips and Flux.gradient still work across all
42 exported layer types, no dispatch ambiguity, and all existing tests
still pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.91%. Comparing base (75b9617) to head (4f7e4fc).

Files with missing lines Patch % Lines
src/generics.jl 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #181      +/-   ##
==========================================
+ Coverage   75.29%   82.91%   +7.61%     
==========================================
  Files          40       40              
  Lines        1789     1621     -168     
==========================================
- Hits         1347     1344       -3     
+ Misses        442      277     -165     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MartinuzziFrancesco
MartinuzziFrancesco merged commit 9268a1d into main Sep 18, 2026
12 of 14 checks passed
@MartinuzziFrancesco
MartinuzziFrancesco deleted the fm/cleanup branch September 18, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant