Skip to content

fix: preserve 2D outputs for (L,1) inputs#1137

Open
MilesCranmerBot wants to merge 7 commits intoMilesCranmer:masterfrom
MilesCranmerBot:fix/torch-export-preserve-dims
Open

fix: preserve 2D outputs for (L,1) inputs#1137
MilesCranmerBot wants to merge 7 commits intoMilesCranmer:masterfrom
MilesCranmerBot:fix/torch-export-preserve-dims

Conversation

@MilesCranmerBot
Copy link
Contributor

Fixes #571.

  • _SingleSymPyModule.forward now:
    • accepts 1D inputs by unsqueezing to (L,1) (helps module composition)
    • preserves (L,1) output shape when the effective input is a single feature column
  • Adds regression tests covering shape preservation + simple module composition.

@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.93%. Comparing base (2ac7e71) to head (275423d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1137      +/-   ##
==========================================
+ Coverage   93.91%   93.93%   +0.02%     
==========================================
  Files          21       21              
  Lines        1643     1649       +6     
==========================================
+ Hits         1543     1549       +6     
  Misses        100      100              

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

@MilesCranmer MilesCranmer changed the title fix(export_torch): preserve 2D outputs for (L,1) inputs fix: preserve 2D outputs for (L,1) inputs Feb 14, 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.

[BUG]: PyTorch module does not preserve dimensions of input tensor

1 participant