class_docstr: a MMPT wrapper class for MMBert style models.
  TODO: move isolated mask to a subclass.
code: def _pooling_vt_layer(self, layered_sequence_output, cmasks, vmasks):
      layer_idx = (
          self.last_iso_layer
          if self.last_iso_layer > 0
          else self.num_hidden_layers
      )
      hidden_state = layered_sequence_output[layer_idx]
      # also output pooled_video and pooled_text.
      batch_size = cmasks.size(0)
      # pool the modality.
      text_offset = vmasks.size(1) + 2  # [CLS] + [SEP]
      # video tokens + [SEP]
      video_outputs = hidden_state[:, 1:text_offset]
      video_attention_mask = torch.cat(
          [
              vmasks,
              torch.ones(
                  (batch_size, 1),
                  dtype=torch.bool,
                  device=vmasks.device,
              ),
          ],
          dim=1,
      )
      assert video_outputs.size(1) == video_attention_mask.size(1)
      pooled_video = torch.sum(
          video_outputs * video_attention_mask.unsqueeze(-1), dim=1
      ) / video_attention_mask.sum(1, keepdim=True)
      # pooled_video = torch.mean(video_outputs[0], dim=1)
  
      # text tokens + [SEP]
      text_attention_mask = cmasks[:, 2:]
      text_outputs = hidden_state[:, text_offset:]
      assert text_outputs.size(1) == text_attention_mask.size(1)
      pooled_text = torch.sum(
          text_outputs * text_attention_mask.unsqueeze(-1), dim=1
      ) / text_attention_mask.sum(1, keepdim=True)
      return pooled_video, pooled_text
  
imports: import torch
  from torch import nn
  from .None import transformermodel
label_desc: Use image node_id 6 for calling the MMFusion obj's underlying member method code with example usage: obj._pooling_vt_layer(layered_sequence_output, cmasks, vmasks) and returns: pooled_video,  pooled_text