I want to pass the same input vector through a number of modules. These modules all have the same architecture and simply vary in their weights.
Currently i am doing it like this:
    def forward(self, modules):
        embeddings = []
        for module in modules:
            embeddings.append(module(self.in_states).flatten())

        return torch.vstack(embeddings)

This is working fine in principal, but is very slow as i do not make use of any parallelization.
I have only one machine with one GPU.
Does somebody know a more efficient was of doing this?