code: def forward(self, caps, cmasks, vfeats, vmasks, **kwargs):
      # ActionLocalization assume of batch_size=1, squeeze it.
      caps = caps.squeeze(0)
      cmasks = cmasks.squeeze(0)
      vfeats = vfeats.squeeze(0)
      vmasks = vmasks.squeeze(0)
  
      # TODO (huxu): other ways to do negative examples; move the following
      # into your criterion forward.
      dummy_caps = (
          torch.LongTensor(
              [
                  [
                      self.cls_token_id,
                      self.sep_token_id,
                      self.pad_token_id,
                      self.sep_token_id,
                  ]
              ],
          )
          .to(caps.device)
          .repeat(vfeats.size(0), 1)
      )
      dummy_cmasks = (
          torch.BoolTensor(
              [[0, 1, 0, 1]]  # pad are valid for attention.
          )
          .to(caps.device)
          .repeat(vfeats.size(0), 1)
      )
  
      outputs = self.forward_video(
          vfeats,
          vmasks,
          dummy_caps,
          dummy_cmasks,
          output_hidden_states=True,
      )
  
      video_seq = (
          outputs[:, 1 : vmasks.size(1) + 1]
          .masked_select(vmasks.unsqueeze(-1))
          .view(-1, self.hidden_size)
      )
  
      pooled_text = self.forward_text(
          caps, cmasks, output_hidden_states=False
      )
  
      # this line is not right.
      logits = torch.mm(video_seq, pooled_text.transpose(1, 0))
      return {"logits": logits}
  
imports: import torch
  from torch import nn
  from .None import transformermodel
label_desc: Use image node_id 2 for calling the MMFusionShareActionLocalization obj's underlying member method code with example usage: obj.forward(caps, cmasks, vfeats, vmasks) and returns: dict