Skip to content
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

nditer usage with index and buffered flags #14168

Open
rschiewer opened this issue Jul 31, 2019 · 1 comment
Open

nditer usage with index and buffered flags #14168

rschiewer opened this issue Jul 31, 2019 · 1 comment

Comments

@rschiewer
Copy link

When using a nditer with any kind of index flag like 'c_index', 'f_index' or 'multi_index', the index will always be zero if the 'buffered' flag is used as well. If this is intended behavior, it does not seem to be documented though.

Reproducing code example:

a = np.arange(4*4*3).reshape(4,4,3)
it = np.nditer(a, flags=['multi_index', 'buffered'])
while not it.finished:
    print(it.multi_index)
    it.iternext()

Numpy/Python version information:

numpy version: 1.17.0
python version: 3.7.4 (default, Jul 9 2019, 18:13:23) [Clang 10.0.1 (clang-1001.0.46.4)]

@seberg
Copy link
Member

seberg commented Aug 5, 2019

It seems like this is unsupported on the C-side, and should probably checked and raise an error when given (or fixed, but I expect fixing it could be a bit more involved, because the buffer machinery probably uses something like external_loop flag always).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants