def forward(self, x1, x2):
        """
        Implementation of Reversible TransformerEncoderLayer

        `
        x = x + self.attn(self.ln1(x))
        x = self.ffn(self.ln2(x), identity=x)
        `
        """
        self.seed_cuda('attn')
        # attention output
        f_x2 = self.attn(self.ln1(x2))
        # apply droppath on attention output
        self.seed_cuda('droppath')
        f_x2_dropped = build_dropout(self.drop_path_cfg)(f_x2)
        y1 = x1 + f_x2_dropped

        # free memory
        if self.training:
            del x1

        # ffn output
        self.seed_cuda('ffn')
        g_y1 = self.ffn(self.ln2(y1))
        # apply droppath on ffn output
        torch.manual_seed(self.seeds['droppath'])
        g_y1_dropped = build_dropout(self.drop_path_cfg)(g_y1)
        # final output
        y2 = x2 + g_y1_dropped

        # free memory
        if self.training:
            del x2

        return y1, y2

        Implementation of Reversible TransformerEncoderLayer

        `
        x = x + self.attn(self.ln1(x))
        x = self.ffn(self.ln2(x), identity=x)
        `
        
mmpretrain/models/backbones/revvit.py