class_docstr: a MMPT wrapper class for MMBert style models.
  TODO: move isolated mask to a subclass.
code: def _mm_attention_mask(self, cmasks, vmasks):
      assert cmasks.size(0) == vmasks.size(0), "{}, {}, {}, {}".format(
          str(cmasks.size()),
          str(vmasks.size()),
          str(cmasks.size(0)),
          str(vmasks.size(0)),
      )
  
      mm_mask = torch.cat([cmasks[:, :1], vmasks, cmasks[:, 1:]], dim=1)
      if self.last_iso_layer == 0:
          # hard attention mask.
          return mm_mask
      else:
          # a gpu iso mask; 0 : num_iso_layer is isolated;
          # num_iso_layer: are MM-fused.
          # make an iso layer
          batch_size = cmasks.size(0)
          iso_mask = self._make_iso_mask(batch_size, cmasks, vmasks)
          mm_mask = mm_mask[:, None, :].repeat(1, mm_mask.size(-1), 1)
          iso_mm_masks = []
          # hard attention mask.
          iso_mask = iso_mask[:, None, :, :].repeat(
              1, self.last_iso_layer, 1, 1
          )
          iso_mm_masks.append(iso_mask)
          if self.last_iso_layer < self.num_hidden_layers:
              mm_mask = mm_mask[:, None, :, :].repeat(
                  1, self.num_hidden_layers - self.last_iso_layer, 1, 1
              )
              iso_mm_masks.append(mm_mask)
          iso_mm_masks = torch.cat(iso_mm_masks, dim=1)
          return iso_mm_masks
  
imports: import torch
  from torch import nn
  from .None import transformermodel
label_desc: Use image node_id 4 for calling the MMFusion obj's underlying member method code with example usage: obj._mm_attention_mask(cmasks, vmasks) and returns: mm_mask, iso_mm_masks