prediction_list = []
for batch_idx, batch_data in enumerate(loader):
if not isinstance(batch_data, (tuple,list)):
batch_data = [batch_data]input_batch = batch_data[0]
if not isinstance(input_batch, (list,tuple)):
input_batch = [input_batch]
input_batch = [Variable(ins) for ins in input_batch]
if cuda_device > -1:
input_batch = [ins.cuda(cuda_device) for ins in input_batch]
prediction_list.append(self(*input_batch))
return torch.cat(prediction_list,0)