class_docstr: This corresponds to the Squeeze and Excitement phase of each block in the original implementation.
class_docstr_tok: ["This","corresponds","to","the","Squeeze","and","Excitement","phase","of","each","block","in","the","original","implementation","."]
code: def __init__(
      self,
      config: EfficientNetConfig,
      in_dim: int,
      expand_dim: int,
      expand: bool = False,
  ):
      super().__init__()
      self.dim = expand_dim if expand else in_dim
      self.dim_se = max(1, int(in_dim * config.squeeze_expansion_ratio))
  
      self.squeeze = nn.AdaptiveAvgPool2d(output_size=1)
      self.reduce = nn.Conv2d(
          in_channels=self.dim,
          out_channels=self.dim_se,
          kernel_size=1,
          padding="same",
      )
      self.expand = nn.Conv2d(
          in_channels=self.dim_se,
          out_channels=self.dim,
          kernel_size=1,
          padding="same",
      )
      self.act_reduce = ACT2FN[config.hidden_act]
      self.act_expand = nn.Sigmoid()
  
imports: import math
  from typing import Optional, Tuple, Union
  import torch
  import torch.utils.checkpoint
  from torch import nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from ...activations import ACT2FN
  from ...modeling_outputs import BaseModelOutputWithNoAttention, BaseModelOutputWithPoolingAndNoAttention, ImageClassifierOutputWithNoAttention
  from ...modeling_utils import PreTrainedModel
  from ...utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging
  from .configuration_efficientnet import EfficientNetConfig
label_desc: Use image node_id 1 to create a new EfficientNetSqueezeExciteLayer object from inherited base classes: nn with example: obj = EfficientNetSqueezeExciteLayer(config, in_dim, expand_dim, expand)