A problem about tensor mul

Now, I have two tensor, one size is (batch_size,3) named A, other is (batch, 1, 208, 208) named B. I want to use A[:,0-2] * B [:,0,:,:], and get a tensor with size (batch, 3, 208, 208).

I think the size of the tensors you are multiplying must be the same at every dimension but the first. It is matrix multiplication after all. Maybe I interpreted your question wrong

Result = A[:,:,None, None] * B[:,:,:,:] ,?

I solved this problem by A.view(-1,3,1,1)*B