class_docstr: Merge patches by taking average of the overlapping area
  
  Args:
      merged_shape: the shape of the tensor required to merge the patches.
      cropped_shape: the shape of the final merged output tensor.
          If not provided, it will be the same as `merged_shape`.
      device: the device for aggregator tensors and final results.
      value_dtype: the dtype for value aggregating tensor and the final result.
      count_dtype: the dtype for sample counting tensor.
code: def __init__(
      self,
      merged_shape: Sequence[int],
      cropped_shape: Sequence[int] | None = None,
      value_dtype: torch.dtype = torch.float32,
      count_dtype: torch.dtype = torch.uint8,
      device: torch.device | str = "cpu",
  ) -> None:
      super().__init__(
          merged_shape=merged_shape,
          cropped_shape=cropped_shape,
          device=device,
      )
      if not self.merged_shape:
          raise ValueError(
              f"`merged_shape` must be provided for `AvgMerger`. {self.merged_shape} is give."
          )
      self.value_dtype = value_dtype
      self.count_dtype = count_dtype
      self.values = torch.zeros(
          self.merged_shape, dtype=self.value_dtype, device=self.device
      )
      self.counts = torch.zeros(
          self.merged_shape, dtype=self.count_dtype, device=self.device
      )
  
imports: from __future__ import annotations
  import threading
  from abc import ABC, abstractmethod
  from collections.abc import Sequence
  from contextlib import nullcontext
  from typing import TYPE_CHECKING, Any
  import numpy
  import torch
  from monai.utils import ensure_tuple_size, optional_import, require_pkg
label_desc: Use image node_id 1 to create a new AvgMerger object from inherited base classes: Merger with example: obj = AvgMerger(merged_shape, cropped_shape, value_dtype, count_dtype, device)