TensorCore.jl icon indicating copy to clipboard operation
TensorCore.jl copied to clipboard

Why not .* and kron?

Open dlfivefifty opened this issue 4 years ago • 5 comments

I’m confused on the roll of this package: why not just use .* (instead of hardamard ) and kron (instead of tensor)?

dlfivefifty avatar May 07 '20 13:05 dlfivefifty

This package is to unicode operators and what IntervalSets.jl was intended for ... We'll hope it's easier.

https://github.com/JuliaGraphics/ColorVectorSpace.jl/issues/126

OK to close?

timholy avatar May 07 '20 14:05 timholy

I get that, the questions was more about the functions themselves. Eg why not

hardamard!(dest, A, B) = broadcast!(*, dest, A, B)

(I guess with bounds checking to prohibit vector special cases)

dlfivefifty avatar May 07 '20 14:05 dlfivefifty

Yep. Also more compiler-friendly. (broadcast is expensive.) But this seems a question about implementation rather than purpose, and of course we'd be happy to have improved implementations.

timholy avatar May 07 '20 14:05 timholy

For custom arrays (like BandedMatrix) broadcast will likely be faster than using indexing so a more sensible default

dlfivefifty avatar May 07 '20 14:05 dlfivefifty

Fair enough. PR would be fine.

timholy avatar May 07 '20 14:05 timholy