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

Thoughts on architecture update (slicing, etc.) #98

Open
rsebbe opened this issue Nov 19, 2018 · 0 comments
Open

Thoughts on architecture update (slicing, etc.) #98

rsebbe opened this issue Nov 19, 2018 · 0 comments

Comments

@rsebbe
Copy link

rsebbe commented Nov 19, 2018

Followup of our twitter conversation.

You'll find a gist with a rethinking of the basic types to make them more similar to NumPy's:

  • make Matrix and MatrixSlice a single type (also remove Slices for Array and Tensor).
  • more powerful slicing, (more like NumPy, including step and reverse direction). Taking some distance from Swift's conventions (ArraySlice have same index as their Array, I don't think this is suitable in this use case: 0-based indexes for slices make more sense IMO)
  • removal of [Int] as index type when dimension is known (Matrix is 2D -> 2 values). Keep [Int] for unknown dimensions (generic N-D Tensor)
  • interaction with external memory storage (good for memory managed by Metal for instance), including non compact layout (offset between rows).

What's not done is reflection about mutability (everything is mutable).

https://gist.github.com/rsebbe/fb2ac50c0cfaa9f2228822eeabf9e659

Feel free to let me know what you think, and if that's a direction you'd like to try for Upsurge.

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

1 participant