-
Notifications
You must be signed in to change notification settings - Fork 0
More customization points in Concatenate
#32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #32 +/- ##
==========================================
- Coverage 72.72% 71.67% -1.06%
==========================================
Files 10 11 +1
Lines 308 353 +45
==========================================
+ Hits 224 253 +29
- Misses 84 100 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@lkdvos let me know what you think. Here's a summary of the changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some general comments:
I'm not sure if it makes sense to include the axes in the type, I might be missing something, but it seems like this is only ever really called once: when you initialize the destination. Since this is not really an expensive call anyways, do we need to cache that? I'm okay with either, just not sure how much that changes.
If we decide to keep it, I do think we probably want an inner constructor where you can pass in the axes yourself. If the only inner constructor computes this, you have to recompute it when you do conversions etc. (also, currently there is no way to not compute it, so the isnothing
check in the function is not really doing anything)
The reason why I added it is because in the current implementation I define
That's a good point, I'll change that. |
Looks like ITensor/ITensorRegistry#71 worked and now the downstream tests "fail" in a better way (i.e. the downstream packages can't be installed, so the tests catch that is the case and pass). |
@lkdvos I think I've addressed most of your comments, let me know what you think. |
This is true, but I would guess that in the blockaxes case you would actually not go through the default implementation in terms of |
Those are fair points. Partially this is following the lead of Broadcast, which also stores the axes (though only after the broadcast expression gets instantiated), and also a conceptual point that |
This is a followup to #18. In #18, the logic for determining the output shape is based on the
Base
logic, which is verysize
-oriented and doesn't allow for customization points for custom axes like blocked axes. This PR is meant to address that, which helps when implementing concatenation in BlockSparseArrays.jl (ITensor/BlockSparseArrays.jl#84).