          if self.initialized:
              self.handles = list()
              if not IS_MACOS and not self.plaid:
                  pynvml.nvmlShutdown()
              self.initialized = False
  
      def get_device_count(self):
          """ Return count of Nvidia devices """
          if self.plaid is not None:
              self.device_count = self.plaid.device_count
 
</s> remove     def get_device_count(self):
        """ Return count of Nvidia devices """
        if self.plaid is not None:
            self.device_count = self.plaid.device_count
 </s> add     def _get_device_count(self):
        """ Detect the number of GPUs attached to the system and allocate to
        :attr:`_device_count`. """
        if self._is_plaidml:
            self._device_count = self._plaid.device_count </s> remove             self.initialized = True
            self.get_device_count()
            self.get_active_devices()
            self.get_handles()

    def shutdown(self):
        """ Shutdown pynvml """
        if self.initialized:
            self.handles = list()
            if not IS_MACOS and not self.plaid:
 </s> add             self._initialized = True
            self._get_device_count()
            self._get_active_devices()
            self._get_handles()

    def _shutdown(self):
        """ Shutdown pynvml if it was the library used for obtaining stats and set
        :attr:`_initialized` back to ``False``. """
        if self._initialized:
            self._handles = list()
            if not IS_MACOS and not self._is_plaidml: </s> remove             self.device_count = pynvx.cudaDeviceGetCount(ignore=True)
 </s> add             self._device_count = pynvx.cudaDeviceGetCount(ignore=True) </s> remove                 self.device_count = 0
        if self.logger:
            self.logger.debug("GPU Device count: %s", self.device_count)

    def get_active_devices(self):
        """ Return list of active Nvidia devices """
        if self.plaid is not None:
            self.active_devices = self.plaid.active_devices
 </s> add                 self._device_count = 0
        self._log("debug", "GPU Device count: {}".format(self._device_count))

    def _get_active_devices(self):
        """ Obtain the indices of active GPUs (those that have not been explicitly excluded by
        CUDA_VISIBLE_DEVICES or plaidML) and allocate to :attr:`_active_devices`. """
        if self._is_plaidml:
            self._active_devices = self._plaid.active_devices </s> remove                 self.active_devices = list(range(self.device_count))
            if self.logger:
                self.logger.debug("Active GPU Devices: %s", self.active_devices)

    def get_handles(self):
        """ Return all listed Nvidia handles """
        if self.plaid is not None:
            self.handles = self.plaid.devices
 </s> add                 self._active_devices = list(range(self._device_count))
            self._log("debug", "Active GPU Devices: {}".format(self._active_devices))

    def _get_handles(self):
        """ Obtain the internal handle identifiers for the system GPUs and allocate to
        :attr:`_handles`. """
        if self._is_plaidml:
            self._handles = self._plaid.devices
            self._initialized = False
          if self.initialized:
              self.handles = list()
              if not IS_MACOS and not self.plaid:
                  pynvml.nvmlShutdown()
            self._initialized = False
  
      def get_device_count(self):
          """ Return count of Nvidia devices """
          if self.plaid is not None:
              self.device_count = self.plaid.device_count
keep keep keep keep replace keep keep keep keep keep
 Core Updates (#1015)

- Remove lib.utils.keras_backend_quiet and replace with get_backend() where relevant
- Document lib.gpu_stats and lib.sys_info
- Remove call to GPUStats.is_plaidml from convert and replace with get_backend()
- lib.gui.menu - typofix 
lib/gpu_stats.py