MCPcopy Create free account
hub / github.com/albertpumarola/GANimation / set_input

Method set_input

models/ganimation.py:98–108  ·  view source on GitHub ↗
(self, input)

Source from the content-addressed store, hash-verified

96 self._loss_d_gp = Variable(self._Tensor([0]))
97
98 def set_input(self, input):
99 self._input_real_img.resize_(input['real_img'].size()).copy_(input['real_img'])
100 self._input_real_cond.resize_(input['real_cond'].size()).copy_(input['real_cond'])
101 self._input_desired_cond.resize_(input['desired_cond'].size()).copy_(input['desired_cond'])
102 self._input_real_id = input['sample_id']
103 self._input_real_img_path = input['real_img_path']
104
105 if len(self._gpu_ids) > 0:
106 self._input_real_img = self._input_real_img.cuda(self._gpu_ids[0], async=True)
107 self._input_real_cond = self._input_real_cond.cuda(self._gpu_ids[0], async=True)
108 self._input_desired_cond = self._input_desired_cond.cuda(self._gpu_ids[0], async=True)
109
110 def set_train(self):
111 self._G.train()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected