code: def save_arrays(savedir, hparams, z_val):
      """Save arrays as npy files.
  
      Args:
        savedir: Directory where arrays are saved.
        hparams: Hyperparameters.
        z_val: Array to save.
      """
      z_save_val = np.array(z_val).reshape(-1, hparams.num_latent)
  
      name = FLAGS.tfrecord_path.split("/")[-1].split(".tfrecord")[0]
      save_name = os.path.join(savedir, "{}_%s.npy".format(name))
      with tf.gfile.Open(save_name % "z", "w") as f:
          np.save(f, z_save_val)
  
      tf.logging.info("Z_Save:{}".format(z_save_val.shape))
      tf.logging.info("Successfully saved to {}".format(save_name % ""))
  
file_path: magenta/magenta/models/nsynth/baseline/save_embeddings.py
imports: import os
  import sys
  from magenta.models.nsynth import reader
  from magenta.models.nsynth import utils
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: save_arrays(savedir, hparams, z_val) without return types