MCPcopy Index your code
hub / github.com/VisionXLab/OF-Diff / get_learned_conditioning

Method get_learned_conditioning

ldm/models/diffusion/ddpm.py:672–683  ·  view source on GitHub ↗
(self, c)

Source from the content-addressed store, hash-verified

670 return self.scale_factor * z
671
672 def get_learned_conditioning(self, c):
673 if self.cond_stage_forward is None:
674 if hasattr(self.cond_stage_model, 'encode') and callable(self.cond_stage_model.encode):
675 c = self.cond_stage_model.encode(c)
676 if isinstance(c, DiagonalGaussianDistribution):
677 c = c.mode()
678 else:
679 c = self.cond_stage_model(c)
680 else:
681 assert hasattr(self.cond_stage_model, self.cond_stage_forward)
682 c = getattr(self.cond_stage_model, self.cond_stage_forward)(c)
683 return c
684
685 def meshgrid(self, h, w):
686 y = torch.arange(0, h).view(h, 1, 1).repeat(1, w, 1)

Callers 4

get_inputMethod · 0.95
forwardMethod · 0.95

Calls 2

encodeMethod · 0.45
modeMethod · 0.45

Tested by

no test coverage detected