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

Array layout #1198

Closed
daniellga opened this issue Aug 22, 2022 · 2 comments
Closed

Array layout #1198

daniellga opened this issue Aug 22, 2022 · 2 comments

Comments

@daniellga
Copy link
Contributor

Hi! I got the array below with a layout CFcf. What does that mean? Is there a place where this is documented?

[[0.0, 0.0, 0.0, 0.0, 0.0, ..., -9.1552734375e-5, -6.103515625e-5, -3.0517578125e-5, 0.0, 3.0517578125e-5]], shape=[1, 294909], strides=[294909, 1], layout=CFcf (0xf), const ndim=2
@jturner314
Copy link
Member

The string describing the layout in the debug format is effectively an internal implementation detail and may change, so it's not documented. The shape and strides fully describe the layout. The layout string is generated when formatting the array, based on the shape and strides. To answer your question, though, the C, F, c, and f are flags describing the shape and strides.

  • A capital C means that the layout can be interpreted as being in C standard layout.
  • A capital F means that the layout can be interpreted as being in Fortran layout.
  • A lowercase c means that iteration prefers C order.
  • A lowercase f means that iteration prefers Fortran order.

@daniellga
Copy link
Contributor Author

Thanks for the detailed info!

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

No branches or pull requests

2 participants