Skip to content

Add ones_map and fill_map split constructors#216

Open
mtfishman wants to merge 1 commit into
mainfrom
mf/ones-fill-map
Open

Add ones_map and fill_map split constructors#216
mtfishman wants to merge 1 commit into
mainfrom
mf/ones-fill-map

Conversation

@mtfishman

Copy link
Copy Markdown
Member

Summary

Adds ones_map and fill_map alongside the existing zeros_map/randn_map/rand_map split constructors, plus the flat ones/fill axis-friendly companions they forward through. They follow the same shape as the rest of the family: ones_map([T,] codomain_axes, domain_axes) fills a map-shaped array with ones and fill_map(v, codomain_axes, domain_axes) with a constant value, flattening to (codomain_axes..., conj.(domain_axes)...) and defaulting the element type from T/v. This rounds out the value-filling *_map set so a backend can build a map-shaped (or charged) tensor with any of the standard fills, not only zeros/randn/rand.

Adds `ones_map` and `fill_map` alongside the existing `zeros_map`/`randn_map`/`rand_map` split constructors, plus the flat `ones`/`fill` axis-friendly companions they forward through. They follow the same shape as the rest of the family: `ones_map([T,] codomain_axes, domain_axes)` fills a map-shaped array with ones and `fill_map(v, codomain_axes, domain_axes)` with a constant value, flattening to `(codomain_axes..., conj.(domain_axes)...)` and defaulting the element type from `T`/`v`. This rounds out the value-filling `*_map` set so a backend can build a map-shaped (or charged) tensor with any of the standard fills, not only zeros/randn/rand.
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.93%. Comparing base (344f8a8) to head (86ef978).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #216      +/-   ##
==========================================
+ Coverage   81.80%   81.93%   +0.12%     
==========================================
  Files          28       28              
  Lines         995     1002       +7     
==========================================
+ Hits          814      821       +7     
  Misses        181      181              
Flag Coverage Δ
docs 21.90% <0.00%> (-0.16%) ⬇️

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.

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