Multiply different dimensions tensors

How to multiply a [2x1] (or [1x2]) tensor by a [2x1x8x8] (which also can be changed to [2x8x8]) tensor?

For elementwise multiplication, you can use the broadcast semantics by A.view(2, 1, 1, 1) * B.

1 Like