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

Do not export unicode operators ⊗ and ⊕? #80

Open
devmotion opened this issue Jan 18, 2021 · 2 comments
Open

Do not export unicode operators ⊗ and ⊕? #80

devmotion opened this issue Jan 18, 2021 · 2 comments

Comments

@devmotion
Copy link

The unicode operators and are generally useful in other fields and other packages as well and therefore might be too generic to be owned and in particular be exported by Kronecker.

For instance, in KernelFunctions will be used for creating tensor product kernels (JuliaGaussianProcesses/KernelFunctions.jl#232) and in MeasureTheory it might be used for creating product measures (JuliaMath/MeasureTheory.jl#159). The lightweight package TensorCore contains default implementations for tensor operations such as and can be implemented by packages with tensor operations to avoid name clashes. Originally, the code was merged in JuliaLang/julia#35150 but later removed in JuliaLang/julia#35744 and moved to its own package.

However, since Kronecker defines its own version of , if one uses KernelFunctions and loads the optional dependency Kronecker, warnings are displayed since both packages define the operator (or reexport in case of KernelFunctions). Unfortunately, it seems Kronecker can't implement TensorCore.:⊗ since TensorCore already contains generic definitions for AbstractArray. Maybe compatibility with TensorCore and other Julia packages could be improved by not exporting Kronecker.:⊗?

@MichielStock
Copy link
Owner

I understand the problem, but the very idea of Kronecker is that it exports as a new matrix product so I would like it to export this by default. If there are conflicts with other packages that export this symbol, it would make more sense to only import the specific elements you need, no?

Still, I made this package with Kronecker kernels in mind. Would it make sense to use this as a base for tensor-based kernels?

@devmotion
Copy link
Author

If there are conflicts with other packages that export this symbol, it would make more sense to only import the specific elements you need, no?

Sure, KernelFunctions does not import anything from Kronecker but calls everything explicitly in the optional methods for this reason. However, users run into this problem if they call using Kronecker with any of the packages that implement TensorCore's interface. If TensorCore would be moved backed to base Julia at some point, users could not avoid the problem even if they only use Kronecker.

Would it make sense to use this as a base for tensor-based kernels?

I am not a contributor of TensorCore but my impression is that it supposed to be a lightweight package without any dependencies apart from standard libraries (the only dependency currently is LinearAlgebra). This is not possible if it depends on Kronecker.

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

No branches or pull requests

2 participants