(split, target)
| 23 | |
| 24 | |
| 25 | def get_varialbe(split, target): |
| 26 | num = len(target) |
| 27 | var = [] |
| 28 | if split == 'train': |
| 29 | for i in range(num): |
| 30 | temp = Variable(target[i], requires_grad=False).contiguous().type(torch.cuda.FloatTensor) |
| 31 | var.append(temp) |
| 32 | else: |
| 33 | for i in range(num): |
| 34 | temp = Variable(target[i]).contiguous().cuda().type(torch.cuda.FloatTensor) |
| 35 | var.append(temp) |
| 36 | return var |
| 37 | |
| 38 | |
| 39 | def print_error(data_type, action_error_sum, is_train): |