          return retval
  
      def _update_tf_dep_nvidia(self) -> None:
          """ Update the Tensorflow dependency for global Cuda installs """
          if self.is_conda:  # Conda handles Cuda and cuDNN so nothing to do here
              return
          tf_ver = None
          cudnn_inst = self.cudnn_version.split(".")
          for key, val in _TENSORFLOW_REQUIREMENTS.items():
              cuda_req = val[0]
 
</s> remove         self.required_packages = [pkg for pkg in self.required_packages
                                  if not pkg[0].startswith("tensorflow-rocm")]
 </s> add         self._required_packages = [pkg for pkg in self._required_packages
                                   if not pkg[0].startswith("tensorflow-rocm")] </s> remove     def _check_missing_dep(self) -> None:
        """ Check for missing dependencies """
        for key, specs in self._env.required_packages:

            if self._env.is_conda:  # Get Conda alias for Key
                key = _CONDA_MAPPING.get(key, (key, None))[0]

            if key not in self._env.installed_packages:
                # Add not installed packages to missing packages list
                self._env.missing_packages.append((key, specs))
                continue

            installed_vers = self._env.installed_packages.get(key, "")

            if specs and not all(self._operators[spec[0]](
                [int(s) for s in installed_vers.split(".")],
                [int(s) for s in spec[1].split(".")])
                                 for spec in specs):
                self._env.missing_packages.append((key, specs))

        for priority in reversed(_PRIORITY):
            # Put priority packages at beginning of list
            package = next((pkg for pkg in self._env.missing_packages if pkg[0] == priority), None)
            if package:
                idx = self._env.missing_packages.index(package)
                self._env.missing_packages.insert(0, self._env.missing_packages.pop(idx))
        logger.debug(self._env.missing_packages)

    def _check_conda_missing_dep(self) -> None:
        """ Check for conda missing dependencies """
        if not self._env.is_conda:
            return
        installed_conda_packages = self._env.get_installed_conda_packages()
        for pkg in self._env.conda_required_packages:
            key = pkg[0].split("==")[0]
            if key not in self._env.installed_packages:
                self._env.conda_missing_packages.append(pkg)
                continue
            if len(pkg[0].split("==")) > 1:
                if pkg[0].split("==")[1] != installed_conda_packages.get(key):
                    self._env.conda_missing_packages.append(pkg)
                    continue
        logger.debug(self._env.conda_missing_packages)

 </s> add  </s> remove     def __init__(self, session_ids):
        logger.debug("Initializing: %s: (session_ids: %s)", self.__class__.__name__, session_ids)
        self._data = {idx: None for idx in session_ids}
        self._carry_over = {}
        self._loss_labels = []
 </s> add     def __init__(self, labels: List[str], timestamps: np.ndarray, loss: np.ndarray) -> None:
        self.labels = labels
        self._loss = zlib.compress(cast(bytes, loss))
        self._timestamps = zlib.compress(cast(bytes, timestamps))
        self._timestamps_shape = timestamps.shape
        self._loss_shape = loss.shape

    @property
    def loss(self) -> np.ndarray:
        """ :class:`numpy.ndarray`: The loss values for this session """
        retval: np.ndarray = np.frombuffer(zlib.decompress(self._loss), dtype="float32")
        if len(self._loss_shape) > 1:
            retval = retval.reshape(-1, *self._loss_shape[1:])
        return retval

    @property
    def timestamps(self) -> np.ndarray:
        """ :class:`numpy.ndarray`: The timestamps for this session """
        retval: np.ndarray = np.frombuffer(zlib.decompress(self._timestamps), dtype="float64")
        if len(self._timestamps_shape) > 1:
            retval = retval.reshape(-1, *self._timestamps_shape[1:])
        return retval

    def add_live_data(self, timestamps: np.ndarray, loss: np.ndarray) -> None:
        """ Add live data to the end of the stored data

        loss: :class:`numpy.ndarray`
            The latest loss values to add to the cache
        timestamps: :class:`numpy.ndarray`
            The latest timestamps  to add to the cache
        """
        new_buffer: List[bytes] = []
        new_shapes: List[Tuple[int, ...]] = []
        for data, buffer, dtype, shape in zip([timestamps, loss],
                                              [self._timestamps, self._loss],
                                              ["float64", "float32"],
                                              [self._timestamps_shape, self._loss_shape]):

            old = np.frombuffer(zlib.decompress(buffer), dtype=dtype)
            if data.ndim > 1:
                old = old.reshape(-1, *data.shape[1:])

            new = np.concatenate((old, data))

            logger.debug("old_shape: %s new_shape: %s", shape, new.shape)
            new_buffer.append(zlib.compress(new))
            new_shapes.append(new.shape)
            del old

        self._timestamps = new_buffer[0]
        self._loss = new_buffer[1]
        self._timestamps_shape = new_shapes[0]
        self._loss_shape = new_shapes[1]


class _Cache():
    """ Holds parsed Tensorflow log event data in a compressed cache in memory. """
    def __init__(self) -> None:
        logger.debug("Initializing: %s", self.__class__.__name__)
        self._data: Dict[int, _CacheData] = {}
        self._carry_over: Dict[int, EventData] = {}
        self._loss_labels: List[str] = [] </s> remove         for pkg in self._env.conda_missing_packages:
 </s> add         for pkg in self._packages.to_install_conda: </s> remove             data = data[idx]
            retval[idx] = {title: data["loss"][:, idx] for idx, title in enumerate(data["labels"])}
 </s> add             data = full_data[idx]
            loss = data["loss"]
            assert isinstance(loss, np.ndarray)
            retval[idx] = {title: loss[:, idx] for idx, title in enumerate(data["labels"])}

        if self._env.is_conda:  # Conda handles Cuda and cuDNN so nothing to do here
          return retval
  
      def _update_tf_dep_nvidia(self) -> None:
          """ Update the Tensorflow dependency for global Cuda installs """
        if self._env.is_conda:  # Conda handles Cuda and cuDNN so nothing to do here
              return
          tf_ver = None
          cudnn_inst = self.cudnn_version.split(".")
          for key, val in _TENSORFLOW_REQUIREMENTS.items():
              cuda_req = val[0]
keep keep keep keep replace keep keep keep keep keep
 Bugfixes
  - plugin.train.unbalanced - decoder b
  - gui.stats - crash when log folder deleted
  - setup.py - install gcc=12.1.0 on linux (scipy dep)
  - setup.py - don't test ROCm unless valid
  - typofix - cli_args extract singleprocess help
typing
  - lib.gui.analysis.event_reader
  - lib.gpu_stats.directml - make platform specific
unit tests
  - lib.gui.analysis.event_reader 
setup.py