How can I access a submatrix specified by row and column index vectors from a matrix (2D tensor) in pytorch?
PyTorch tensors support python slicing so you can use A[:2, 2:] to access the first two rows and the last two columns as a 2x2 tensor.
Please consider a matrix 
A= torch.tensor([[1,2,3,4], [1,2,3,4], [1,2,3,4], [1,2,3,4]] 
and vectors of indexes 
ind_1= [0,1] and ind_2= [2,3]. 
Is it possible to access the top-right sub-matrix of the matrix A ([[3,4], [3,4]]) without using any for loops?  Naively using A[ind_1, ind_2] merely returns the elements 3 and 4 (the diagonal of the required sub-matrix).