title: How to assign to pixels in an image in eager tensorflow?
body: <p>I have a need to rasterize points into image form inside my model, and I can't figure out the right way to do this. The issues are 1) tensorflow doesn't handle "assignment" to tensors very intuitively and 2) eager mode doesn't handle creation of tensors very intuitively</p>
  
  <p>Here's what I'm trying to do</p>
  
  <pre><code>rope_images = tfe.Variable(
              initial_value=lambda: tf.zeros([batch_size, self.sdf_shape[0], self.sdf_shape[1], self.n_points]),
              name='rope_images',
              trainable=False)
  row_y_indeces = tf.cast(points[:, :, 1] / resolution[:, 0:1] + origin[:, 0:1], tf.int64)
  col_x_indeces = tf.cast(points[:, :, 0] / resolution[:, 1:2] + origin[:, 1:2], tf.int64)
  batch_indeces = tf.reshape(tf.tile(tf.reshape(tf.range(batch_size), [-1, 1]), [1, self.n_points]), [-1])
  row_indeces = tf.squeeze(row_y_indeces)
  col_indeces = tf.squeeze(col_x_indeces)
  point_channel_indeces = tf.tile(tf.range(self.n_points, dtype=tf.int64), [batch_size])
  indeces = tf.transpose(tf.stack([batch_indeces, row_indeces, col_indeces, point_channel_indeces]))
  on_pixels = tf.gather_nd(rope_images, indeces)
  tf.assign(on_pixels, 1)
  
  </code></pre>
  
  <p>But I get the error:</p>
  
  <pre><code>AttributeError: 'Tensor' object has no attribute 'assign'
  </code></pre>
  
  <p>What's the right way to do this?</p>