Its returning tuple.
this is my code for custom batch:
def customBatchBuilder(samples):
    imgs_batch, question_batch ,length_batch,ans_batch = zip(*samples)
    # Sort sequences based on length
    seqLengths = [len(seq) for seq in question_batch]
 
    sorted_list = sorted(zip(list(imgs_batch), question_batch, seqLengths,ans_batch), key = lambda x: -x[2])
    
    imgs_batch, question_batch, seqLengths,ans_batch  = zip(*sorted_list)
    
    paddedSeqs = torch.nn.utils.rnn.pad_sequence(question_batch, batch_first=True)
   # Create tensor with padded sequences.
    print(type(imgs_batch))
    #print("##############")
    
    return imgs_batch,paddedSeqs,seqLengths,ans_batch