MCPcopy Create free account
hub / github.com/CompVis/diff2flow / forward

Method forward

diff2flow/conditioning/encoders.py:87–93  ·  view source on GitHub ↗
(self, x, *args, **kwargs)

Source from the content-addressed store, hash-verified

85 self.uncond = torch.from_numpy(cond).squeeze(0)
86
87 def forward(self, x, *args, **kwargs):
88 bs = x.shape[0]
89 device = x.device
90 if self.uncond.device is not device:
91 self.uncond = self.uncond.to(device)
92
93 return self.uncond[None, :].repeat(bs, 1, 1)
94
95
96class FrozenOpenCLIPImageEmbedder(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected