| 309 | # self.logger.info('fixing BN [{}]'.format(name)) |
| 310 | |
| 311 | def prepare_data(self): |
| 312 | ginfo = self.ginfo |
| 313 | |
| 314 | tmp = self.tmp |
| 315 | tmp.input_var = dict() |
| 316 | |
| 317 | if ginfo.task_type == 'pairwise': |
| 318 | tmp.input_var['image'] = torch.autograd.Variable(torch.cat((tmp.input['image1'], tmp.input['image2']), 0).cuda()) |
| 319 | tmp.input_var['label'] = torch.autograd.Variable(torch.cat((tmp.input['label'], tmp.input['label']), 0).cuda()) |
| 320 | else: |
| 321 | for k,v in tmp.input.items(): |
| 322 | if not isinstance(v, list): |
| 323 | tmp.input_var[k] = torch.autograd.Variable(v.cuda()) |
| 324 | |
| 325 | def _set_randomseed(self, seed): |
| 326 | random.seed(seed) |