class_docstr: Logger class.
code: def record_losses(self, prefix, losses, step):
      for loss_name, val in losses.items():
          if isinstance(val, tf.Tensor):
              val = val.numpy()
          self.losses[loss_name].append(val)
          if step % self.save_loss_tensorboard_frequency == 0:
              name = f"{prefix}{loss_name}"
              self.record_scalar(name, val, step)
          if step % self.print_loss_frequency == 0:
              print(f"Step: {step}, Loss {loss_name}: {val}")
  
file_path: graphics/tensorflow_graphics/projects/points_to_3Dobjects/utils/logger.py
imports: import collections
  import os
  import tensorflow
label_desc: Use image node_id 4 for calling the Logger obj's underlying member method code with example usage: obj.record_losses(prefix, losses, step) without return types