src/transformers/models/resnet/modeling_tf_resnet.py/TFResNetBasicLayer/__init__
class TFResNetBasicLayer:    def __init__(
        self, in_channels: int, out_channels: int, stride: int = 1, activation: str = "relu", **kwargs
    ) -> None:
        super().__init__(**kwargs)
        should_apply_shortcut = in_channels != out_channels or stride != 1
        self.conv1 = TFResNetConvLayer(out_channels, stride=stride, name="layer.0")
        self.conv2 = TFResNetConvLayer(out_channels, activation=None, name="layer.1")
        self.shortcut = (
            TFResNetShortCut(out_channels, stride=stride, name="shortcut")
            if should_apply_shortcut
            else tf.keras.layers.Activation("linear", name="shortcut")
        )
        self.activation = ACT2FN[activation]