title: tensorflow change/assign matrix element values by list of (different range of 2d) slices
body: <p>I have a zero matrix (we can view it as a picture):</p>
  
  <p><code>matrix = tf.zeros(name="matrix", shape=(4, 5), dtype=tf.int32)</code></p>
  
  <p>and tensor of tetrads that indicate some "boxes" (by top-left and bottom-right vertex, maybe overlapped) on this <code>matrix</code>:</p>
  
  <p><code>(first_row, first_column, second_row, second_column)</code> </p>
  
  <p>here, <code>[first_row:second_row, first_column,second_column]</code> forms one box on the <code>matrix</code>.</p>
  
  <p>And the question is: how can i assign/change all the "boxed value" on the picture from <code>0</code> to <code>1</code>, using the slicing <code>[first_row:second_row, first_column,second_column]</code> or other tensorflow functions?</p>
  
  <p><strong>Update</strong>:</p>
  
  <p>Input:</p>
  
  <p><code>matrix = tf.zeros(name="matrix", shape=(4, 5), dtype=tf.int32)</code></p>
  
  <pre><code>first_row = tf.constant([0,2])
  first_column = tf.constant([2,1])
  second_row = tf.constant([3,3])
  second_column = tf.constant([3,3])
  </code></pre>
  
  <p>The expected output (by boxes example <code>(0,2,3,3)</code> and <code>(2,1,3,3)</code>):</p>
  
  <pre><code>array([[0, 0, 1, 1, 0],
         [0, 0, 1, 1, 0],
         [0, 1, 1, 1, 0],
         [0, 1, 1, 1, 0]])
  </code></pre>