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

chore: Make all arrays little-endian #48

Merged
merged 1 commit into from
Mar 5, 2025
Merged

chore: Make all arrays little-endian #48

merged 1 commit into from
Mar 5, 2025

Conversation

seanmcl
Copy link
Collaborator

@seanmcl seanmcl commented Mar 4, 2025

Endian-ness is a nice feature in NumPy; it's clear what the data should represent, it handles operations on arrays with different orderings, etc. But it's largely just an optimization. In our code, which is slow to begin with, we do not need this optimization. We remove considerable complexity by forcing all arrays in TensorLib to be little-endian.

One outcome of this is that we will save all .npy files as littleendian and rely on the Python programmer to convert if necessary.

Endian-ness is a nice feature in NumPy; it's clear what the data should
represent, it handles operations on arrays with different orderings, etc.
But it's largely just an optimization. In our code, which is slow to
begin with, we do not need this optimization. We remove considerable
complexity by forcing all arrays in TensorLib to be little-endian.

One outcome of this is that we will save all .npy files as littleendian
and rely on the Python programmer to convert if necessary.
Copy link
Collaborator

@govereau govereau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Lots of simplification.

@seanmcl seanmcl merged commit 9e794a9 into main Mar 5, 2025
1 check passed
@seanmcl seanmcl deleted the sm/04-remove-order branch March 5, 2025 21:33
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

Successfully merging this pull request may close these issues.

2 participants