Rust-Scientific-Computing / feotensor

Tensor library for scientific computing in Rust
MIT License
2 stars 0 forks source link

Implement Tensor struct #2

Closed siliconlad closed 3 months ago

siliconlad commented 3 months ago

@CameronMatthew can you have a look and see if this is heading in the right direction.

Very rough around the edges (can you flatten an n-dimensional tensor in your head?), but that can be patched up with refinements to the API and maybe some additional macros.

Also code is a bit of a mess (wth is iters.rs) but gotta start somewhere

siliconlad commented 3 months ago

I have restructured the code to have some of the features that we want. NamelyDynamicStorage which abstracts away the memory mapping of the tensor. I have also tweaked some of the interfaces for the methods as mentioned above (e.g. returning Result in various places).

I'm going to press ahead with some further restructurings:

I'm ignoring the specific implementations of the methods for now because they work (even if they are over-complicated). I will revisit them at the end and tidy them up as well as implement any of the other missing functionality.

siliconlad commented 3 months ago

Would be good to have another review of the code written so far. I've implemented most of the methods outlined in #1 so far (missing more of the advanced features). Before I add any more, would like to get some feedback on the structure of everything. The way I've done it seems to work, but there's a fair bit of duplication. Perhaps there's a better way.

Largely ignore the code within the methods for now. A lot of it needs to be looked at and refactored (unless you want to suggest a way to refactor it). They do get the job done though so :shrug: (I've never had more tests than I have for this repository I don't think ahaha).

@CameronMatthew @Dougal-s

CameronMatthew commented 3 months ago

I had a quick look and seems fine. I think we should just merge this asap now.

For the following reasons...

TL;DR Ship it 🚢!

siliconlad commented 3 months ago

Sounds good to me.