class_docstr: RegNet's Y layer: an X layer with Squeeze and Excitation.
class_docstr_tok: ["RegNet","'s","Y","layer",":","an","X","layer","with","Squeeze","and","Excitation","."]
code: def __init__(
      self,
      config: RegNetConfig,
      in_channels: int,
      out_channels: int,
      stride: int = 1,
      **kwargs,
  ):
      super().__init__(**kwargs)
      should_apply_shortcut = in_channels != out_channels or stride != 1
      groups = max(1, out_channels // config.groups_width)
      self.shortcut = (
          TFRegNetShortCut(
              in_channels, out_channels, stride=stride, name="shortcut"
          )
          if should_apply_shortcut
          else tf.keras.layers.Activation("linear", name="shortcut")
      )
      self.layers = [
          TFRegNetConvLayer(
              in_channels,
              out_channels,
              kernel_size=1,
              activation=config.hidden_act,
              name="layer.0",
          ),
          TFRegNetConvLayer(
              out_channels,
              out_channels,
              stride=stride,
              groups=groups,
              activation=config.hidden_act,
              name="layer.1",
          ),
          TFRegNetSELayer(
              out_channels,
              reduced_channels=int(round(in_channels / 4)),
              name="layer.2",
          ),
          TFRegNetConvLayer(
              out_channels,
              out_channels,
              kernel_size=1,
              activation=None,
              name="layer.3",
          ),
      ]
      self.activation = ACT2FN[config.hidden_act]
  
imports: from typing import Optional, Tuple, Union
  import tensorflow
  from ...activations_tf import ACT2FN
  from ...file_utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward
  from ...modeling_tf_outputs import TFBaseModelOutputWithNoAttention, TFBaseModelOutputWithPoolingAndNoAttention, TFSequenceClassifierOutput
  from ...modeling_tf_utils import TFPreTrainedModel, TFSequenceClassificationLoss, keras_serializable, unpack_inputs
  from ...tf_utils import shape_list
  from ...utils import logging
  from .configuration_regnet import RegNetConfig
label_desc: Use image node_id 1 to create a new TFRegNetYLayer object from inherited base classes: tf.keras.layers with example: obj = TFRegNetYLayer(config, in_channels, out_channels, stride)