I have defined a model which performs convolutions over a batch of character-sequences.
kernals = [3, 4, 5, 6]
cnns = []
for k in kernals:
  seq = nn.Sequential(
                      nn.Conv1d(char_embed_size, output_size // 4, k, padding=0),
                      nn.Tanh(),
                      nn.MaxPool1d(max_seq_length - k + 1)
                      )
  cnns.append(seq)
self.cnns = nn.ModuleList(cnns)

In my forward method I obtain a representation for each sequence using:
def forward(self, char_emb):
  #char_emb has shape (batch_size, char_emb_size, max_seq_len)
  tmp = [cnn(char_emb).squeeze() for cnn in self.cnns]
  seq_representations = torch.cat(tmp, dim=1)
  return seq_representations

Is there a way to avoid the synchronous loop [cnn(char_emb).squeeze() for cnn in self.cnns] and have all the cnns in self.cnns to parallelly perform convolutions over the input?