MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / shared_step

Method shared_step

ldm/models/diffusion/ddpm.py:842–845  ·  view source on GitHub ↗
(self, batch, **kwargs)

Source from the content-addressed store, hash-verified

840 return self.first_stage_model.encode(x)
841
842 def shared_step(self, batch, **kwargs):
843 x, c = self.get_input(batch, self.first_stage_key)
844 loss = self(x, c)
845 return loss
846
847 def forward(self, x, c, *args, **kwargs):
848 t = torch.randint(0, self.num_timesteps, (x.shape[0],), device=self.device).long()

Callers

nothing calls this directly

Calls 1

get_inputMethod · 0.95

Tested by

no test coverage detected