code: def _trial_summary(hparams, examples_path, output_dir):
      """Writes a tensorboard text summary of the trial."""
  
      examples_path_summary = tf.summary.text(
          "examples_path",
          tf.constant(examples_path, name="examples_path"),
          collections=[],
      )
  
      hparams_dict = hparams.values()
  
      # Create a markdown table from hparams.
      header = "| Key | Value |\n| :--- | :--- |\n"
      keys = sorted(hparams_dict.keys())
      lines = [
          "| %s | %s |" % (key, str(hparams_dict[key])) for key in keys
      ]
      hparams_table = header + "\n".join(lines) + "\n"
  
      hparam_summary = tf.summary.text(
          "hparams",
          tf.constant(hparams_table, name="hparams"),
          collections=[],
      )
  
      with tf.Session() as sess:
          writer = tf.summary.FileWriter(output_dir, graph=sess.graph)
          writer.add_summary(examples_path_summary.eval())
          writer.add_summary(hparam_summary.eval())
          writer.close()
  
file_path: magenta/magenta/models/music_vae/music_vae_train.py
imports: import os
  from magenta.models.music_vae import configs
  from magenta.models.music_vae import data
  import tensorflow.compat.v1
  import tf_slim
label_desc: Use image node_id 1 for calling a global function with example usage: _trial_summary(hparams, examples_path, output_dir) without return types