code: def build_train_batch(records: Sequence[BaseRecord]):
      images, masks, img_metas = [], [], []
      for record in records:
          images.append(im2tensor(record.img))
          img_metas.append(_img_meta_mask(record))
          masks.append(
              tensor(record.segmentation.mask_array.data).long()
          )
  
      data = {
          "img": torch.stack(images),
          "img_metas": img_metas,
          "gt_semantic_seg": torch.stack(masks),
      }
  
      return data, records
  
file_path: icevision/icevision/models/mmseg/common/dataloaders.py
imports: from icevision.imports import *
  from icevision.core import *
  from icevision.models.utils import *
  from icevision.utils import *
label_desc: Use image node_id 6 for calling a global function with example usage: build_train_batch(records) and returns: data,  records