Hi J!



 J_Johnson:

Is there an easier/faster/more efficient way to do this


You may use the expression for element-wise multiplication, C = A * B,
and pytorch will use broadcasting to multiply all of the images and channels
in A by B.
Note that broadcasting treats “missing” leading dimensions as if they were
singleton dimensions, so C = A * B.unsqueeze (0).unsqueeze (0)
would be equivalent (but, to be clear, there is no reason, even stylistic,
to use unsqueeze() in this case).
Best.
K. Frank