SciSharp / NumSharp

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

Slice inteface added to generic NDArray<T> #265

Closed katdti closed 5 years ago

katdti commented 5 years ago

Slice inteface added to generic NDArray. Slice benchmark tests added using slicing of generic NDArray.

katdti commented 5 years ago

Cancel this pull request. Slicing a generic NDArray does not work as expected. MakeGeneric clones the sliced array preventing any assignment to flow back to the original storage array.

henon commented 5 years ago

Slicing and views are very new in NumSharp. I guess we should make a generic NDArray to be a view of an ungeneric one, then your code would work. please don'T throw it away just yet

henon commented 5 years ago

By the way, your benchmarks are also valuable. Some of them are also touch on a thing that is still missing in the slicing logic: negative indices.