Ivorforce / NumDot

Tensor math and scientific computation for the Godot game engine.
https://numdot.readthedocs.io
MIT License
20 stars 7 forks source link

Multidimensional index lists ("index views") #15

Closed Ivorforce closed 1 month ago

Ivorforce commented 2 months ago

While a bit niche in the tensor space, index views are an undeniably useful feature.

xtensor has support for index views, though returning a copy thereof would run into similar limitations as #8.

Still, selection by index arrays could be very useful, even without a view returned.

Ivorforce commented 2 months ago

8 is implemented. However, as expected, the current implementation does not allow for index views, as the final compute arrays are xarray_adaptor objects. These only support shapes and strides. If we wanted index views, we could add a whole slew of compute arrays, but that would probably explode the binary size.

For now, we should just return a copy, like numpy. We can reconsider later if there is interest.

Ivorforce commented 1 month ago

Implemented in d18ad545bd5aa82f0ec463af88df294221e0897b.