title: Tensorflow Dataset .map() API
body: <p>Couple of questions about this</p>
  
  <p>For occasions when I'd like to do something like the following in Tensorflow (assume I'm creating training examples by loading WAV files):</p>
  
  <pre><code>import tensorflow as tf 
  
  def _some_audio_preprocessing_func(filename):
     # ... some logic here which mostly uses Tensorflow ops ...
     with tf.Session(graph=tf.Graph()) as sess:
          wav_filename_placeholder = tf.placeholder(tf.string, [])
          wav_loader = io_ops.read_file(wav_filename_placeholder)
          wav_decoder = contrib_audio.decode_wav(wav_loader, desired_channels=1)
          data = sess.run(
                  [wav_decoder],
                  feed_dict={wav_filename_placeholder: filename})
          return data
  
  dataset = tf.data.Dataset.list_files('*.wav')
  dataset = dataset.map(_some_preprocessing_func)
  </code></pre>
  
  <ol>
  <li>If I have a parse_image() function that uses tensor ops - should
  this be part of the main Graph? Following the example set <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/speech_commands/input_data.py#L109" rel="noreferrer">in Google's own audio TF tutorial</a>, it looks like they create a separate graph! Doesn't this ruin the point of using Tensorflow to make things faster?</li>
  <li>Do I use tf.py_func() any time any single line isn't from the tensorflow library? Again, I wonder what the performance implications are and when I should use this...</li>
  </ol>
  
  <p>Thanks!</p>