title: Is there any diffrence between index_select and tensor[sequence] in PyTorch?
body: <p>everyone. I'm new to PyTorch. Now I'm learning the indexing of a tensor. I notice that we can indexing a tensor by <code>tensor.index_select()</code> and <code>tensor[sequence]</code>.  </p>
  
  <pre class="lang-py prettyprint-override"><code>In [1]: x = torch.randn(3, 4)
  
  In [2]: indices = torch.tensor([0, 2])
  
  In [3]: x.index_select(0, indices)
  Out[3]:
  tensor([[ 0.2760, -0.9543, -1.0499,  0.7828],
          [ 1.3514, -1.1289,  0.5052, -0.0547]])
  
  In [4]: x[[0,2]]
  Out[4]:
  tensor([[ 0.2760, -0.9543, -1.0499,  0.7828],
          [ 1.3514, -1.1289,  0.5052, -0.0547]])
  </code></pre>
  
  <p>I am puzzled about these two methods and look for some doc. But I failed. Can anyone can tell me are there some differences between them and what are these difference?</p>