class_docstr: Computes audio samples and losses.
class_docstr_tok: ["Computes","audio","samples","and","losses","."]
code: def flush(self, step):
      latest_losses = {}
      for k, metric in self._avg_losses.items():
          latest_losses[k] = metric.result()
          tf.summary.scalar(
              "losses/{}".format(k), metric.result(), step=step
          )
          metric.reset_states()
  
imports: import ddsp
  from ddsp.training import heuristics
  from ddsp.training import metrics
  from ddsp.training import summaries
  import gin
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 4 for calling the BasicEvaluator obj's underlying member method code with example usage: obj.flush(step) without return types