class_docstr: Helper class to merge final image on GPU. This generally faster than moving individual tiles to CPU.
docstr: Accumulates batch of tile predictions
  :param batch: Predicted tiles  of shape [B,C,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",",","H",",","W","]",":","param","crop_coords",":","Corresponding","tile","crops","w.r.t","to","original","image"]
code: def integrate_batch(self, batch: torch.Tensor, crop_coords):
      """
      Accumulates batch of tile predictions
      :param batch: Predicted tiles  of shape [B,C,H,W]
      :param crop_coords: Corresponding tile crops w.r.t to original image
      """
      if len(batch) != len(crop_coords):
          raise ValueError(
              "Number of images in batch does not correspond to number of coordinates"
          )
  
      if batch.device != self.image.device:
          batch = batch.to(device=self.image.device)
  
      # Ensure that input batch dtype match the target dtyle of the accumulator
      if batch.dtype != self.image.dtype:
          batch = batch.type_as(self.image)
  
      for tile, (x, y, tile_width, tile_height) in zip(
          batch, crop_coords
      ):
          self.image[:, y : y + tile_height, x : x + tile_width] += (
              tile * self.weight
          )
          self.norm_mask[
              :, y : y + tile_height, x : x + tile_width
          ] += self.weight
  
imports: import dataclasses
  import math
  from typing import List, Iterable, Tuple, Union, Sequence
  import cv2
  import numpy
  import torch
label_desc: Use image node_id 3 for calling the TileMerger obj's underlying member method code with example usage: obj.integrate_batch(batch, crop_coords) without return types