MCPcopy Create free account
hub / github.com/JunlinHan/DCLGAN / set_input

Method set_input

models/simdcl_model.py:169–178  ·  view source on GitHub ↗

Unpack input data from the dataloader and perform necessary pre-processing steps. Parameters: input (dict): include the data itself and its metadata information. The option 'direction' can be used to swap domain A and domain B.

(self, input)

Source from the content-addressed store, hash-verified

167 self.optimizer_F.step()
168
169 def set_input(self, input):
170 """Unpack input data from the dataloader and perform necessary pre-processing steps.
171 Parameters:
172 input (dict): include the data itself and its metadata information.
173 The option 'direction' can be used to swap domain A and domain B.
174 """
175 AtoB = self.opt.direction == 'AtoB'
176 self.real_A = input['A' if AtoB else 'B'].to(self.device)
177 self.real_B = input['B' if AtoB else 'A'].to(self.device)
178 self.image_paths = input['A_paths' if AtoB else 'B_paths']
179
180 def forward(self):
181 """Run forward pass; called by both functions <optimize_parameters> and <test>."""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected