src/transformers/models/mask2former/modeling_mask2former.py/Mask2FormerPredictionBlock/__init__
class Mask2FormerPredictionBlock:    def __init__(self, in_dim: int, out_dim: int, activation: nn.Module) -> None:
        super().__init__()
        self.layers = [nn.Linear(in_dim, out_dim), activation]
        # Maintain submodule indexing as if part of a Sequential block
        for i, layer in enumerate(self.layers):
            self.add_module(str(i), layer)