Skip to content

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

Closed
lenianiva wants to merge 2 commits into
JuliaDiff:mainfrom
lenianiva:bug/projection-zero-sized
Closed

lenianiva wants to merge 2 commits 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

codecov Bot commented Jan 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.63%. Comparing base (0ae32d8) to head (e2b5670).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #702   +/-   ##
=======================================
  Coverage   93.63%   93.63%           
=======================================
  Files          15       15           
  Lines        1022     1022           
=======================================
  Hits          957      957           
  Misses         65       65           

☔ 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.

@lenianiva lenianiva changed the title fix: Allow arbitrary reshape if array is zero sized fix: Allow arbitrary reshape in projection if array is zero sized Jan 19, 2026
@CarloLucibello

Copy link
Copy Markdown
Member

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.

@lenianiva

Copy link
Copy Markdown
Author

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.

After poking around for months I still cannot find the underlying issue that caused this.

@devmotion

Copy link
Copy Markdown
Member

Were you able to figure out the underlying issue/path that caused this gradient shape?

@lenianiva

lenianiva commented Nov 7, 2026 •

Copy link
Copy Markdown
Author

Were you able to figure out the underlying issue/path that caused this gradient shape?

The bug seems to have been fixed on main.

@lenianiva lenianiva closed this Nov 7, 2026
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.

3 participants