title: How do I mutate value of a tensor in Tensorflow.js?
body: <p>How do I mutate value of a tensor in Tensorflow.js? For example if I have a tensor created like this:
  <code>
  const a = tf.tensor1d([1,2,3,4])
  </code></p>
  
  <p>How do I change the value of the third element of the tensor? I know that tensors are immutable and variables are mutable. </p>
  
  <p>Doing this: <code>const a = tf.variable(tf.tensor1d([1,2,3,4]))</code> doesn't seem to solve the problem. I cannot do:</p>
  
  <p><code>const a = a[0].assign(5)</code></p>
  
  <p>I am able to do this in <strong>python tensorflow</strong> like this:</p>
  
  <p><code>
  a = tf.Variable([1,2,3,4])
  a = a[0].assign(100)
  with tf.Session() as sess:
     sess.run(tf.global_variables_iniliazer())
     print sess.run(a)
  </code></p>
  
  <p>This outputs <code>[100, 2,3,4]</code></p>