class_docstr: A structure for storing masks and their related data in batched format.
  Implements basic filtering and concatenation.
class_docstr_tok: ["A","structure","for","storing","masks","and","their","related","data","in","batched","format",".","Implements","basic","filtering","and","concatenation","."]
code: def cat(self, new_stats: "MaskData") -> None:
      for k, v in new_stats.items():
          if k not in self._stats or self._stats[k] is None:
              self._stats[k] = deepcopy(v)
          elif isinstance(v, torch.Tensor):
              self._stats[k] = torch.cat([self._stats[k], v], dim=0)
          elif isinstance(v, np.ndarray):
              self._stats[k] = np.concatenate(
                  [self._stats[k], v], axis=0
              )
          elif isinstance(v, list):
              self._stats[k] = self._stats[k] + deepcopy(v)
          else:
              raise TypeError(
                  f"MaskData key {k} has an unsupported type {type(v)}."
              )
  
imports: import numpy
  import torch
  import math
  from copy import deepcopy
  from itertools import product
  from typing import Any, Dict, Generator, ItemsView, List, Tuple
label_desc: Use image node_id 7 for calling the MaskData obj's underlying member method code with example usage: obj.cat(new_stats) without return types