Skip to content

fix: Allow arbitrary reshape in projection if array is zero sized - #702

Open
lenianiva wants to merge 1 commit into
JuliaDiff:mainfrom
lenianiva:bug/projection-zero-sized
Open

fix: Allow arbitrary reshape in projection if array is zero sized#702
lenianiva wants to merge 1 commit into
JuliaDiff:mainfrom
lenianiva:bug/projection-zero-sized

Conversation

@lenianiva

Copy link
Copy Markdown

This fixes a bug where during backpropagation the size of an array e.g. (1, 1, 0) does not match the size of the gradient e.g. (4, 1, 0). The error only happens for zero-sized arrays.

See an example here: JuliaGraphs/GraphNeuralNetworks.jl#638

@codecov

codecovBot commented Jan 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.50%. Comparing base (004e43e) to head (8a5c3e9).

Additional details and impacted files
@@ Coverage Diff @@## main #702 +/- ##
=======================================
Coverage 93.49% 93.50% =======================================
Files 15 15 Lines 999 1000 +1 =======================================
+ Hits 934 935 +1 
Misses 65 65 

☔ View full report in Codecov by Sentry.
📢 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.

@lenianivalenianiva changed the title fix: Allow arbitrary reshape if array is zero sizedfix: Allow arbitrary reshape in projection if array is zero sizedJan 19, 2026
@CarloLucibello

Copy link
Copy Markdown

merge?

@devmotion

Copy link
Copy Markdown
Member

It would be interesting to know first why the gradient has an incorrect shape. And ideally then we could fix the underlying issue instead of relaxing the projection.

Sign up for freeto 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.

3 participants

@lenianiva@CarloLucibello@devmotion