Add ones_map and fill_map split constructors#216
Open
mtfishman wants to merge 1 commit into
Open
Conversation
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.
1 task
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
ones_mapandfill_mapalongside the existingzeros_map/randn_map/rand_mapsplit constructors, plus the flatones/fillaxis-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 andfill_map(v, codomain_axes, domain_axes)with a constant value, flattening to(codomain_axes..., conj.(domain_axes)...)and defaulting the element type fromT/v. This rounds out the value-filling*_mapset so a backend can build a map-shaped (or charged) tensor with any of the standard fills, not only zeros/randn/rand.