Hi,

This maybe a very simple question but it’s troubling me.

I am trying to write convolution using matrix multiplication using fold and unfold methods.

My matrix multiplication output after reshaping is (1, 24, 26, 26). I have to add bias to it which is a 1-D tensor or shape (24).

I am assuming that the bias tensor has to be expanded to the shape (1,24,26,26) such that each of the 26*26 elements for each of 24 indices are same as the original value.

Can someone suggest me the fastest way to add the bias value to the cnn output using pytorch functions?

Thanks!