(sess, net, audio, encoding)
return audio_gen
Generate a single sample of audio from an encoding.

  Args:
    sess: tf.Session to use.
    net: Loaded wavenet network (dictionary of endpoint tensors).
    audio: Previously generated audio [batch_size, 1].
    encoding: Encoding at current time index [batch_size, dim].

  Returns:
    audio_gen: Generated audio [batch_size, 1]
Generate a single sample of audio from an encoding.
Generate a single sample of audio from an encoding .
def generate_audio_sample(sess, net, audio, encoding):
  """Generate a single sample of audio from an encoding.

  Args:
    sess: tf.Session to use.
    net: Loaded wavenet network (dictionary of endpoint tensors).
    audio: Previously generated audio [batch_size, 1].
    encoding: Encoding at current time index [batch_size, dim].

  Returns:
    audio_gen: Generated audio [batch_size, 1]
  """
  probability_mass_function = sess.run(
      [net["predictions"], net["push_ops"]],
      feed_dict={net["X"]: audio, net["encoding"]: encoding})[0]
  sample_bin = sample_categorical(probability_mass_function)
  audio_gen = utils.inv_mu_law_numpy(sample_bin - 128)
  return audio_gen
def generate_audio_sample ( sess , net , audio , encoding ) : probability_mass_function = sess . run ( [ net [ "predictions" ] , net [ "push_ops" ] ] , feed_dict = { net [ "X" ] : audio , net [ "encoding" ] : encoding } ) [ 0 ] sample_bin = sample_categorical ( probability_mass_function ) audio_gen = utils . inv_mu_law_numpy ( sample_bin - 128 ) return audio_gen