def forward(self, x, identity=None):
        """Forward function for `FFN`.

        The function would add x to the output tensor if residue is None.
        """
        out = self.layers(x)
        if not self.add_identity:
            return self.dropout_layer(out)
        if identity is None:
            identity = x
        return identity + self.dropout_layer(out)
Forward function for `FFN`.

        The function would add x to the output tensor if residue is None.
        
ControlNet-v1-1-nightly/annotator/uniformer/mmcv/cnn/bricks/transformer.py