class_docstr: SqueezeExcitation
class_docstr_tok: ["SqueezeExcitation"]
code: def _scale(self, input_tensor: Tensor) -> Tensor:
      if self.causal:
          x_space = torch.mean(input_tensor, dim=[3, 4], keepdim=True)
          scale = self.temporal_cumualtive_gavg3d(x_space)
          scale = torch.cat((scale, x_space), dim=1)
      else:
          scale = F.adaptive_avg_pool3d(input_tensor, 1)
      scale = self.fc1(scale)
      scale = self.activation_1(scale)
      scale = self.fc2(scale)
      return self.activation_2(scale)
  
imports: from typing import Any, Callable, Optional, Tuple, Union
  from einops import rearrange
  import torch
  from torch.nn.modules.utils import _triple
  import torch.nn.functional
  from torch import nn, Tensor
  from towhee.models.utils.general_utils import make_divisible
  from towhee.models.utils.causal_module import CausalModule
  from towhee.models.layers.activations import HardSigmoid
  from towhee.models.layers.conv_bn_activation import Conv2dBNActivation, Conv3DBNActivation
  from towhee.models.layers.padding_functions import same_padding
  from towhee.models.layers.tf_avgpool3d import TfAvgPool3D
  from towhee.models.layers.temporal_cg_avgpool3d import TemporalCGAvgPool3D
label_desc: Use image node_id 2 for calling the SqueezeExcitation obj's underlying member method code with example usage: obj._scale(input_tensor) and returns: self