Skip to content

Read single axes of a GradedArray directly - #292

Merged
mtfishman merged 1 commit into
mainfrom
mf/allocate-output-overhead
Oct 27, 2026
Merged

mtfishman merged 1 commit into
mainfrom
mf/allocate-output-overhead

Conversation

@mtfishman

Copy link
Copy Markdown
Member

Summary

axes(a, d) on a GradedArray fell back to Base's method, which returns either the axis or a trailing OneTo(1), so contraction and permutation code reading axes one at a time could not infer it. Reading the stored axis directly makes allocating a permuted output about 40% faster. An out-of-range d now throws.

`axes(a, d)` returns the stored axis instead of going through Base's fallback, which builds the whole tuple and returns a union with a trailing `OneTo(1)`. An out-of-range `d` now throws.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.80%. Comparing base (ba8d7e3) to head (29be7ad).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #292      +/-   ##
==========================================
+ Coverage   85.79%   85.80%   +0.01%     
==========================================
  Files          40       40              
  Lines        2844     2847       +3     
==========================================
+ Hits         2440     2443       +3     
  Misses        404      404              
Flag Coverage Δ
docs 16.61% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@mtfishman
mtfishman enabled auto-merge (squash) October 27, 2026 15:03
@mtfishman
mtfishman merged commit eceb349 into main Oct 27, 2026
19 checks passed
@mtfishman
mtfishman deleted the mf/allocate-output-overhead branch October 27, 2026 15:22
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