For example, I have a matrix M of size (m, n). And I want to sum elementwise powers of this matrix M: e.g.
M^a + M^b + M^c. [a,b,c] will be given as a tensor. Note that it is elementwise not matrix multiplication.
Using for loop is too slow.