Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lsix
Copy link

@lsix lsix commented May 12, 2021

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 lsix changed the title xt::linalg::kron: support arguments of arbitrary number of dimensions [WIP] xt::linalg::kron: support arguments of arbitrary number of dimensions May 17, 2021
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
Copy link
Author

lsix commented May 17, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant