title: Python-Making a training and testing set from a tensor
body: <p>I have two tensors one real_image_tensors  and one drawing_tensors they are both currently in order, where the first image in real_image_tensors is the reference picture for the drawing in drawing_tensor. I need to keep them in order,  but split them into a training set tensor  and a testing set tensor. So I would have four different tensors.</p>
  <p>ok  here is my code:</p>
  <pre><code>num_images = len(real_image_tensors)
  num_training = int(num_images * 0.8)
  num_test = num_images - num_training
  training_real_image_tensors = real_image_tensors[0:num_training]
  training_drawing_tensors = drawing_tensors[0:num_training]
  test_real_image_tensors = real_image_tensors[num_training:num_images]
  test_drawing_tensors = drawing_tensors[num_training:len(drawing_tensors)]
  </code></pre>
  <p>I thought this worked until I print out an image in  all 4 tensors using :</p>
  <pre><code>plt.Figure()
  plt.imshow(training_real_image_tensors)
  </code></pre>
  <p>and I learned that when I print out the images in the test it Crops out part of the images. see:
  <a href="https://i.stack.imgur.com/kiBTY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kiBTY.png" alt="Colab screenshot" /></a></p>
  <p>yeah this did not work out at all like how I thought it would.</p>
  <p>And when I use model_selection.train_test_split(), it Shuffle my images and I need to keep them in order, because again the Reference pictures for the drawings are in the same corresponding indexes and I need to keep like that for my Pix2Pix Gan.</p>