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

Method get_input

ldm/models/diffusion/ddpm.py:426–432  ·  view source on GitHub ↗
(self, batch, k)

Source from the content-addressed store, hash-verified

424 return self.p_losses(x, t, *args, **kwargs)
425
426 def get_input(self, batch, k):
427 x = batch[k]
428 if len(x.shape) == 3:
429 x = x[..., None]
430 x = rearrange(x, 'b h w c -> b c h w')
431 x = x.to(memory_format=torch.contiguous_format).float()
432 return x
433
434 def shared_step(self, batch):
435 x = self.get_input(batch, self.first_stage_key)

Callers 9

shared_stepMethod · 0.95
log_imagesMethod · 0.95
on_train_batch_startMethod · 0.45
get_inputMethod · 0.45
get_inputMethod · 0.45
log_imagesMethod · 0.45
get_inputMethod · 0.45
get_inputMethod · 0.45
get_inputMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected