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

Method set_input

models/cut_model.py:125–134  ·  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

123 self.optimizer_F.step()
124
125 def set_input(self, input):
126 """Unpack input data from the dataloader and perform necessary pre-processing steps.
127 Parameters:
128 input (dict): include the data itself and its metadata information.
129 The option 'direction' can be used to swap domain A and domain B.
130 """
131 AtoB = self.opt.direction == 'AtoB'
132 self.real_A = input['A' if AtoB else 'B'].to(self.device)
133 self.real_B = input['B' if AtoB else 'A'].to(self.device)
134 self.image_paths = input['A_paths' if AtoB else 'B_paths']
135
136 def forward(self):
137 """Run forward pass; called by both functions <optimize_parameters> and <test>."""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected