(self, x, *args, **kwargs)
| 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 | |
| 96 | class FrozenOpenCLIPImageEmbedder(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected