code: def forward(self, x, mask):
      mask = self.mask_blurring(
          nn.functional.interpolate(
              mask,
              size=x.size()[-2:],
              mode="bilinear",
              align_corners=True,
          )
      )
      background = self.background_gate(x)
      foreground = self.learning_block(self.foreground_gate(x))
      mix = self.mix_gate(x)
      output = mask * (foreground + mix) + (1 - mask) * background
      return output
  
file_path: carefree-learn/cflearn/api/cv/third_party/iharm/model/base/ssam_model.py
imports: import torch
  from functools import partial
  from torch import nn
  from ..ops import ChannelAttention
  from ..modeling.unet import UNetDecoder
  from ..modeling.unet import UNetEncoder
  from ..modeling.basic_blocks import ConvBlock
  from ..modeling.basic_blocks import GaussianSmoothing
label_desc: Use image node_id 2 for calling the SpatialSeparatedAttention obj's underlying member method code with example usage: obj.forward(x, mask) and returns: output