Community
cancel
Showing results for 
Search instead for 
Did you mean: 
xianfeng__liang
Beginner
61 Views

How to implement numpy broadcast mechanism with mkl?

How to implement numpy broadcast mechanism with mkl?

  I have been confused, how to use mkl to efficiently implement the broadcast mechanism in numpy ((Element wise operator "+","-","*")?
such as
2-D array sub 1-D array
[[1,2,3],
[4,5,6],
[7,8,9]]
-
[1, 2, 3]
=
[[0, 0, 0],
[3, 3, 3],
[6, 6, 6]]


And the second operation (can be understood as a matrix multiplied by a diagonal matrix)
2-D array multiply 1-D array(Element wise multiply )
[[1,2,3],
[4,5,6],
[7,8,9]]
*
[1, 2, 3]
=
[[1, 4, 9],
[4, 10, 18],
[7, 16, 27]]

0 Kudos
1 Reply
Gennady_F_Intel
Moderator
61 Views

the same as https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/802035

Reply