Hey guys,
So I am just wondering whether there is an existing function to find the Kronecker product of two matrices? Here is a Chinese article on that:
https://blog.csdn.net/P_LarT/article/details/101066757
in which they used einsum
to achieve this. Though direct function would be much faster as tbh I don’t think einsum
is efficient. So is there one? Thanks.
albanD
(Alban D)
January 30, 2020, 1:07am
2
Hi,
The article you link has a link to this forum. In particular this discussion Kronecker Product that seem to contain the answer you seek.
I was thinking function based on einsum won’t be efficient?
albanD
(Alban D)
January 30, 2020, 6:37pm
4
Why not?
Also the post you sent has a code sample with ger and reshape which does not use einsum.
idk just intuitively I don’t think it’s using vectorization… nvm if it doesn’t matter
albanD
(Alban D)
February 3, 2020, 4:35pm
6
It is doing its best to. But it is not perfect indeed.
But ger
+ reshape
will give you what you want