title: Efficient way of getting the values in a certain area of a 2D vector
body: <p>Lets say for example I have a 2 dimensional vector of integers, e.g:</p>
  
  <pre><code>0,1,4,7,3,7,3,7,7,2
  3,6,3,1,7,9,2,8,3,6
  1,4,9,3,5,8,3,2,8,5
  2,5,8,4,9,3,2,9,0,1
  3,6,3,1,7,9,2,8,3,6
  1,4,9,3,5,8,3,2,8,5
  </code></pre>
  
  <p>and I want to get another 2D vector that contains the values from index 2 to 5 horizontally and indexes 1 to 3 vertically, I will illustrate the values I need with '■'.</p>
  
  <pre><code>0,1,4,7,3,7,3,7,7,2
  3,6,■,■,■,■,■,8,3,6
  1,4,■,■,■,■,■,2,8,5
  2,5,■,■,■,■,■,9,0,1
  3,6,3,1,7,9,2,8,3,6
  1,4,9,3,5,8,3,2,8,5
  </code></pre>
  
  <p>the 2D vector I want in this instance:</p>
  
  <pre><code>3,1,7,9,2
  9,3,5,8,3
  8,4,9,3,2
  </code></pre>
  
  <p>I need this to be very efficient since I an using this in a convolutional neural network to get the area of the input image that the filter is currently over, and it will need to do this thousands of times. (in my case I will be using it to get a 3D vector out of another 3D vector, but I assume scaling it up shouldn't be too difficult, and it is much easier to explain my idea using 2D vectors)</p>