SciSharp / NumSharp

High Performance Computation for N-D Tensors in .NET, similar API to NumPy.
https://github.com/SciSharp
Apache License 2.0
1.36k stars 189 forks source link

Simple implementation of 2D transpose #332

Closed JetstreamRoySprowl closed 5 years ago

Nucs commented 5 years ago

@Oceania2018 In short: No and we probably won't.

At the moment we do not support layout at all. For now, I'll add support for transpose that will perform a swap of the axes (similar to what changing layout does) and that's it. We already have quite high complexity code related to GetIndex (which is now GetOffset) because we need to handle slicing and broadcasting, adding layout will multiply it

Nucs commented 5 years ago

If a user is indeed using a layout 'F' then he can simple transpose the data prior to working with it. Even save it afterwards to avoid that action in the next time.

Nucs commented 5 years ago

After reviewing how numpy performs transpose; np.transpose and many other relies on np.swapaxes. This implementation is a solid 2d-2d transpose but unless its nd-nd, I rather leave np.transpose unimplemented. Thanks a lot though.