xtensor-blas icon indicating copy to clipboard operation
xtensor-blas copied to clipboard

[WIP] xt::linalg::kron: support arguments of arbitrary number of dimensions

Open lsix opened this issue 3 years ago • 1 comments

Before this commit, xt::linalg::kron only supports 2D arguments. This commit proposes to add support for argument with any number of dimensions. This change of behavior is coherent with what numpy.kron does.

The current implementation is a performance step back compared to the previous one. Until a better generic implementation is found, keeping a couple of specialized implementations for the most used scenarios makes sense.

Tested with ./test/test_xtensor_blas --gtest_filter=xlinalg.kron*.

lsix avatar May 12 '21 13:05 lsix

I have pushed a revised implementation that has significantly better performances compared to the first one. However, it still is an order of magnitude slower than the original one for the 2D scenario.

I intend to spend more time on this to improve things further and hopefully come up with a solution that is general and offers acceptable performances.

lsix avatar May 17 '21 23:05 lsix