I also get a similar error…Thougn I checked and all my data seems to be on GPU…msg I get:
*** TypeError: torch.index_select received an invalid combination of arguments - got (torch.cuda.FloatTensor, int, torch.cuda.FloatTensor), but expected (torch.cuda.FloatTensor source, int dim, torch.cuda.LongTensor index)

my question is at:

  
    
    
    How to get mini-batches in pytorch in a clean and efficient way? 
  
  
    I thought I had asked this on the pytorch forum but it seems I have not. How do we index a data set in a variable? I tried: 
def get_batch2(X,Y,M):
    '''
    get batch for pytorch model
    '''
    X,Y = X, Y
    N = X.size()[0]
    batch_indices = torch.LongTensor( np.random.randint(0,N+1,size=M) )
    pdb.set_trace()
    batch_xs = torch.index_select(X,0,batch_indices)
    batch_ys = torch.index_select(Y,0,batch_indices)
    return Variable(batch_xs, requires_grad=False), Variable(batch_ys, …