title: torch find indices of matching rows in 2 2D tensors
body: <p>I have two 2D tensors, in different length, both are different subsets of the same original 2d tensor and I would like to find all the matching "rows"<br>
  e.g<Br></p>
  
  <pre><code>A = [[1,2,3],[4,5,6],[7,8,9],[3,3,3]
  B = [[1,2,3],[7,8,9],[4,4,4]]
  torch.2dintersect(A,B) -&gt; [0,2] (the indecies of A that B also have)
  </code></pre>
  
  <p>I've only see numpy solutions, that use dtype as dicts, and does not work for pytorch.</p>
  
  <p><br>
  Here is how I do it in numpy<br></p>
  
  <pre><code>arr1 = edge_index_dense.numpy().view(np.int32)
  arr2 = edge_index2_dense.numpy().view(np.int32)
  arr1_view = arr1.view([('', arr1.dtype)] * arr1.shape[1])
  arr2_view = arr2.view([('', arr2.dtype)] * arr2.shape[1])
  intersected = np.intersect1d(arr1_view, arr2_view, return_indices=True)
  </code></pre>