class_docstr: Perform linear projection or Transformer-based decoder (optionally MultiScale)
  for mask prediction models.
  Args:
      blocks (MultiScaleBlock): the encoder blocks to provide input dimensions of the head.
      num_classes (int): the dimension of the prediction target (eg. HOG or pixels).
      feat_sz (list): the spatiotemporal sizes of the input features.
class_docstr_tok: ["Perform","linear","projection","or","Transformer-based","decoder","(","optionally","MultiScale",")","for","mask","prediction","models",".","Args",":","blocks","(","MultiScaleBlock",")",":","the","encoder","blocks","to","provide","input","dimensions","of","the","head",".","num_classes","(","int",")",":","the","dimension","of","the","prediction","target","(","eg",".","HOG","or","pixels",")",".","feat_sz","(","list",")",":","the","spatiotemporal","sizes","of","the","input","features","."]
code: def forward(self, block_outputs, output_masks, return_all, thw):
      model_outputs = []
      for idx, x in enumerate(block_outputs):
          for _, blk in enumerate(self.transforms[idx]):
              if isinstance(blk, MultiScaleBlock):
                  x, thw = blk(x, thw)
              else:
                  x = blk(x)
  
          if self.cls_embed_on:
              x = x[:, 1:]
          if not return_all:
              mask = output_masks[idx]
              x = x[mask]
          x = self.projections[idx](x)
          model_outputs.append(x)
      return model_outputs
  
imports: from functools import partial
  import torch
  import torch.nn
  from detectron2.layers import ROIAlign
  import slowfast.utils.logging
  from slowfast.models.attention import MultiScaleBlock
  from slowfast.models.batchnorm_helper import NaiveSyncBatchNorm1d
  from slowfast.models.nonlocal_helper import Nonlocal
label_desc: Use image node_id 3 for calling the MSSeparateHead obj's underlying member method code with example usage: obj.forward(block_outputs, output_masks, return_all, thw) and returns: model_outputs