Thank you so much. There is no errors reported anymore. However, the code is stuck in the gradcheck and cannot get out. My code is shown below. Is there anything wrong?
for step, (x, y, l) in enumerate(dset_loaders['Train']):        

        b_x = Variable(x.cuda(GPU_ID).view(-1, TIME_STEP, INPUT_SIZE), requires_grad = True)  
        b_y = torch.squeeze(Variable(y.cuda(GPU_ID)))                  
        b_l = torch.squeeze(Variable(l.cuda(GPU_ID)))

        b_x, b_l = sort_batch(b_x, b_l)

        output = model(b_x, b_l)              
        loss = loss_func(output, b_y)  
        optimizer.zero_grad()          

        print gradcheck(model, (b_x,b_l))

        loss.backward()              

        torch.nn.utils.clip_grad_norm(model.parameters(), 1)
        optimizer.step()