title: How to apply a function to the value of a tensor and then assigning the output to the same tensor
body: <p>I want to project the updated weights of my network (after performing optimization) to a special space in which I need the value of that tensor to be passed. The function which applies projection gets a numpy array as an input. Is there a way I can do this? </p>
  
  <p>I used tf.assign() as a solution but since my function accepts arrays and not tensors it failed.</p>
  
  <p>Here is a sketch of what I want to do:</p>
  
  <pre><code>W = tf.Variable(...)
  ...
  opt = tf.train.AdamOptimizer(learning_rate).minimize(loss, var_list=['W'])
  W = my_function(W)
  </code></pre>