Hi Deponce!



 deponce:

How do I define a layer “custom_conv2d_layer()”, which contains several of my custom conv2d layers in parallel?


I don’t fully understand your use case, but take a look at torch.nn.Module 1.
You could package your “custom_conv2d” as a Module.  (You don’t
have to, but you could.)  Then you could define “custom_cond2d_layer”
also as a Module.  Your “custom_cond2d_layer” Module could contain
16 “custom_cond2d” Modules as “properties.”
Your “custom_cond2d_layer” Module's forward() function would apply
each “custom_cond2d” to the appropriate part of the input and then, for
example, cat() together the results of the 16 “custom_cond2ds” to
form the output returned by forward().
Best.
K. Frank