MCPcopy Create free account
hub / github.com/chenhaoxing/HDNet / set_input

Method set_input

models/hdnet_model.py:33–45  ·  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.

(self, input)

Source from the content-addressed store, hash-verified

31 self.optimizers.append(self.optimizer_G)
32
33 def set_input(self, input):
34 """Unpack input data from the dataloader and perform necessary pre-processing steps.
35 Parameters:
36 input (dict): include the data itself and its metadata information.
37 """
38 self.comp = input['comp'].to(self.device)
39 self.real = input['real'].to(self.device)
40 self.mask = input['mask'].to(self.device)
41 self.inputs = self.comp
42 if self.opt.input_nc == 4:
43 self.inputs = torch.cat([self.inputs, self.mask], 1) # channel-wise concatenation
44 self.real_f = self.real * self.mask
45 self.bg = self.real * (1 - self.mask)
46
47 def forward(self):
48 self.output = self.netG(self.inputs, self.mask)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected