HI guys:there are two multi-dimension matrixa=[64,10,1,1]; b=[64,10,28,28]
I found that a*b can be implemented in TensorFlow. And the result is also [64,10,28,28].But when I used Pytorch, it didn't work.
So how should I do?
I assume that you are looking for element-wise multiplication where the last two dimensions are broadcasted for a?If so, you can do this with a.expand_as(b) * b
a.expand_as(b) * b
Thanks,@albanD. you surgesstion works.