-
Notifications
You must be signed in to change notification settings - Fork 160
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
ComponentTensor needs at least an index to have an extent
#3825
Comments
|
Perhaps the issue is upside down then and what one really wants is |
So
What is the situation under which
Is that what you're doing? |
Ah I see - if I use Indices to index expressions their extent is modified: indices = gem.indices(len(T.shape))
assert indices[0].extent is None # true
T[indices]
assert indices[0].extent is None # false! Causes assertion error. I wasn't expecting this.
Yes it is. |
Ah, OK,
And
In this case I would do:
Since I assume you have the shape lying around somewhere. |
Is this OK to close? |
Well |
It's a user-interface "nicety". Indices need to carry their extent, but sometimes it's easier to just make them before you know the extent they'll need and then have it set on use (note that the extent is only ever changed from |
Apologies this was meant to say that they don't have docstrings |
The answer seems to me to be that if you let indices have no extent then it should be very clearly documented somewhere that this will be set upon use |
ComponentTensor
makes the below assertion:which cannot be done if none of the indices have an
extext
.This typically comes up when creating indices with
gem.indices
which do not set theextent
property of the indices.The text was updated successfully, but these errors were encountered: