MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / prepare_data

Method prepare_data

PATH/core/solvers/solver.py:311–323  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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)

Callers 1

runMethod · 0.95

Calls 2

cudaMethod · 0.45
catMethod · 0.45

Tested by

no test coverage detected