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
Copy Markdown
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
Copy Markdown

codecov bot commented Feb 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.27%. Comparing base (c435527) to head (a342033).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1137      +/-   ##
==========================================
+ Coverage   94.25%   94.27%   +0.02%     
==========================================
  Files          21       21              
  Lines        1687     1693       +6     
==========================================
+ Hits         1590     1596       +6     
  Misses         97       97              

☔ 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
@MilesCranmerBot MilesCranmerBot force-pushed the fix/torch-export-preserve-dims branch from 275423d to a342033 Compare April 14, 2026 09:15
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