where conv1(3,1,1) means kernel size is 3, stride 1 and padding 1
The output of conv1 will be concatenate with the output of conv2. It is easy to using torch.cat function to concatenate them. However, I am using the function self.add_module to write the network. How could I use concatenation function on the case? This is my sample code
I Guess you do this into a Sequential Module? the sequential module can only perform sequential operations (not two branch and merge the results). You will need to implement the forward function for this yourself I’m afraid.
For example, you can wrap these 4 ops in a custom nn.Module with your forward that concatenates the outputs and then add this new module to your Sequential one.