class_docstr: Fine-tuning wrapper for action segmentation.
  TODO: rename this for VLM.
code: def forward(
      self, caps, cmasks, vfeats, vmasks, attention_mask=None, **kwargs
  ):
      # ActionLocalization assume of batch_size=1, squeeze it.
      caps = caps.view(-1, caps.size(-1))
      cmasks = cmasks.view(-1, cmasks.size(-1))
      vfeats = vfeats.view(-1, vfeats.size(2), vfeats.size(3))
      vmasks = vmasks.view(-1, vmasks.size(-1))
  
      # this may not cover all shapes of attention_mask.
      attention_mask = (
          attention_mask.view(
              -1, attention_mask.size(2), attention_mask.size(3)
          )
          if attention_mask is not None
          else None
      )
  
      # TODO (huxu): other ways to do negative examples; move the following
      # into your criterion forward.
      output_hidden_states = True
  
      #  video forwarding, text is dummy; never use attention_mask.
      attention_mask, token_type_ids = self._mm_on_the_fly(
          cmasks, vmasks, attention_mask
      )
  
      logits = self.mm_encoder(
          input_ids=caps,
          input_video_embeds=vfeats,
          attention_mask=attention_mask,
          token_type_ids=token_type_ids,
          output_hidden_states=output_hidden_states,
      )
      return {"logits": logits[0][:, 1 : vmasks.size(1) + 1]}
  
imports: import torch
  from torch import nn
  from .None import transformermodel
label_desc: Use image node_id 1 for calling the MMFusionActionSegmentation obj's underlying member method code with example usage: obj.forward(caps, cmasks, vfeats, vmasks, attention_mask) and returns: dict