class_docstr: Helper class to merge volume segmentations on CPU/GPU.
class_docstr_tok: ["Helper","class","to","merge","volume","segmentations","on","CPU\/GPU","."]
docstr: Accumulates batch of tile predictions
  :param batch: Predicted tiles  of shape [B,C,D,H,W]
  :param crop_coords: Corresponding tile crops w.r.t to original image
docstr_tok: ["Accumulates","batch","of","tile","predictions",":","param","batch",":","Predicted","tiles","of","shape","[","B",",","C",",","D",",","H",",","W","]",":","param","crop_coords",":","Corresponding","tile","crops","w.r.t","to","original","image"]
code: def integrate_batch(self, batch: torch.Tensor, rois):
      """
      Accumulates batch of tile predictions
      :param batch: Predicted tiles  of shape [B,C,D,H,W]
      :param crop_coords: Corresponding tile crops w.r.t to original image
      """
      if len(batch) != len(rois):
          raise ValueError(
              "Number of images in batch does not correspond to number of coordinates"
          )
  
      batch = batch.to(device=self.volume.device)
      for tile, roi in zip(batch, rois):
          weighted_tile = tile * self.weight
          self.volume[
              :, roi[0], roi[1], roi[2]
          ] += weighted_tile.type_as(self.volume)
          self.norm_mask[:, roi[0], roi[1], roi[2]] += self.weight
  
file_path: pytorch-toolbelt/pytorch_toolbelt/inference/tiles_3d.py
imports: from typing import Union, Tuple, List, Iterable, Any
  import numpy
  import torch
  from pytorch_toolbelt.inference import compute_pyramid_patch_weight_loss
label_desc: Use image node_id 3 for calling the VolumeMerger obj's underlying member method code with example usage: obj.integrate_batch(batch, rois) without return types