title: Manually changing nodes in a TensorFlow network
body: <p>I have a standard fully connected feedforward network with ReLU activations, which looks like</p>
  
  <pre><code>x -&gt; h1 -&gt; h2 -&gt; h3 -&gt; out
  </code></pre>
  
  <p>and I've trained it to learn a simple function (sum the inputs and take <code>sin</code>). As an experiment, I want to inject different functions of <code>x</code> in the network. So, for example, if <code>h2</code> has size <code>[None, 20]</code> then I want to set <code>h2[:,0] = x[:,0]**2</code> - I want the first node in layer <code>h2</code> to be the function that takes the first coordinate of the original input and squares it.</p>
  
  <p>The function <code>scatter_nd_update</code> doesn't work because the thing I'm trying to assign to an entry of <code>h2</code> is a <code>Variable</code>, and I'm pretty sure it doesn't make sense to assign to <code>h2</code> anyway. What else can I do?</p>