class_docstr: Helper class to merge final image on GPU. This generally faster than moving individual tiles to CPU.
docstr: :param image_shape: Shape of the source image
  :param image_margin:
  :param weight: Weighting matrix
docstr_tok: [":","param","image_shape",":","Shape","of","the","source","image",":","param","image_margin",":",":","param","weight",":","Weighting","matrix"]
code: def __init__(
      self,
      image_shape,
      channels,
      weight,
      device="cpu",
      dtype=torch.float32,
  ):
      """
  
      :param image_shape: Shape of the source image
      :param image_margin:
      :param weight: Weighting matrix
      """
      self.image_height = image_shape[0]
      self.image_width = image_shape[1]
      self.channels = channels
  
      self.weight = torch.from_numpy(np.expand_dims(weight, axis=0)).to(
          device=device, dtype=dtype
      )
      self.image = torch.zeros(
          (channels, self.image_height, self.image_width),
          device=device,
          dtype=dtype,
      )
      self.norm_mask = torch.zeros(
          (1, self.image_height, self.image_width),
          device=device,
          dtype=dtype,
      )
  
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 1 to create a new TileMerger object  with example: obj = TileMerger(image_shape, channels, weight, device, dtype)