title: How to efficiently restrict tensorflow model output?
body: <p>I have a model, e.g. </p>
  
  <pre><code>model = keras.Sequential([
      keras.layers.Reshape(target_shape=(10,10,1),input_shape=(100,)),
      keras.layers.Convolution2DTranspose(1, 3, activation='relu')
  ])
  </code></pre>
  
  <p>After it's trained, I would only like to do compute a subset of the outputs, e.g. </p>
  
  <pre><code>out = model(x)[:,3,5]
  </code></pre>
  
  <p>Is there a way to do this efficiently so that I'm not computing all of the outputs? Ideally, I'd like to define a new model that takes x and the output indices only computes them, e.g.</p>
  
  <pre><code>out = new_model(x,out_indices) 
  </code></pre>