-
Notifications
You must be signed in to change notification settings - Fork 321
Number of elements when slicing by axis #578
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
Comments
Edit: My original answer was incorrect because I mixed up the semantics of For Both of the following statements are true:
Maybe I'm misunderstanding the question? |
I actually think that the previous answer was correct for what I was asking 😛
But they are empty if at least one of other axes has length 0. So checking if the whole array is empty will basically tell me if there is any non-trivial reduction to be performed using |
Let's look at some examples:
If one of the other axes has length 0, then there are 0 views for
That depends on how "non-trivial" is defined. If the whole array is empty, then there are two possibilities:
|
I am trying to understand what is the correct way to understand when
map_axis
will be operating on empty arrays.The minimal example that is giving me problems is the following:
The array is empty, hence all slices (both wrt the first and the second axis) don't contain any element.
But if I ask for
I get 1 as answer because the shape of the array is
[1, 0]
. Should I combine the outputlen_of
with the product of the other entries in the shape (excluding the one I am to slice the array)?The text was updated successfully, but these errors were encountered: