title: Replacing feed_dict in TF2.0 for tensor inputs to tensors in a function
body: <p>I have a Keras Callback that retrieves values from particular Keras layers like so:</p>
  
  <pre><code>def run(self, fetches, next_batch):
      """Run fetches using the validation data passed in during initialization."""
      input_data, target_data = self.sess.run(next_batch)
      feed_dict = {self.model.inputs[0]: input_data,
                   self.model._targets[0]: target_data}
      result = self.sess.run(fetches=fetches, feed_dict=feed_dict)
      return result
  </code></pre>
  
  <p><code>next_batch</code> was a Dataset.make_one_shot_iterator.get_next() call in tf1. I've replaced it with next(iter(ds)). That part works fine.</p>
  
  <p>However I cannot figure out how to rewrite the sess.run() call. I want to get output from the 'fetches' tensors, but their inputs are other tensors higher up in the Model. I know which tensors are my input tensors, but how do I pass data into them and get the outputs I want from the tensors in later layers?</p>
  
  <p>I read the <a href="https://www.tensorflow.org/guide/migrate" rel="nofollow noreferrer">conversion documentation</a> on this subject but it is REALLY terse and unhelpful. I was not able to find much more information on stackoverflow.</p>