          loss = summary.simple_value
          if not loss:
              # Need to convert a tensor to a float for TF2.8 logged data. This maybe due to change
              # in logging or may be due to work around put in place in FS training function for the
              # following bug in TF 2.8 when writing records:
              #  https://github.com/keras-team/keras/issues/16173
              loss = float(tf.make_ndarray(summary.tensor))
  
          step.setdefault("loss", []).append(loss)
  
 
</s> remove             for name, value in logs.items():
                tf.summary.scalar(
                    "batch_" + name,
                    value,
                    step=self._model._model._train_counter)  # pylint:disable=protected-access
 </s> add             with tf.summary.record_if(True), self._tensorboard._train_writer.as_default():  # noqa pylint:disable=protected-access,not-context-manager
                for name, value in logs.items():
                    tf.summary.scalar(
                        "batch_" + name,
                        value,
                        step=self._tensorboard._train_step)  # pylint:disable=protected-access
        else:
            self._tensorboard.on_train_batch_end(self._model.iterations, logs=logs) </s> remove         self._tensorboard.on_train_batch_end(self._model.iterations, logs=logs)
        if get_tf_version() == 2.8:
            # Bug in TF 2.8 where batch recording got deleted.
 </s> add         if get_tf_version() > 2.7:
            # Bug in TF 2.8/2.9 where batch recording got deleted. </s> remove     def load_model_weights(self):
 </s> add     def load_model_weights(self) -> None: </s> remove     def append_softmax_activation(self, layer_index=-1):
 </s> add     def append_softmax_activation(self, layer_index: int = -1) -> None: </s> remove     def load_model(self):
 </s> add     def load_model(self) -> None:
            # following bug in TF 2.8/2.9 when writing records:
          loss = summary.simple_value
          if not loss:
              # Need to convert a tensor to a float for TF2.8 logged data. This maybe due to change
              # in logging or may be due to work around put in place in FS training function for the
            # following bug in TF 2.8/2.9 when writing records:
              #  https://github.com/keras-team/keras/issues/16173
              loss = float(tf.make_ndarray(summary.tensor))
  
          step.setdefault("loss", []).append(loss)
  
keep keep keep keep replace keep keep keep keep keep
 Update TF to 2.9
    - Update TF to 2.7 to 2.9
    - Bump dependencies
    - Remove decode from pynvml calls
    - force keras predict functions to non-verbose
    - update tests
    - update Tensorboard logging
    - Update docs 
lib/gui/analysis/event_reader.py