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

Method get_input

ldm/models/autoencoder.py:110–115  ·  view source on GitHub ↗
(self, batch, k)

Source from the content-addressed store, hash-verified

108 return dec, posterior
109
110 def get_input(self, batch, k):
111 x = batch[k]
112 if len(x.shape) == 3:
113 x = x[..., None]
114 x = x.permute(0, 3, 1, 2).to(memory_format=torch.contiguous_format).float()
115 return x
116
117 def training_step(self, batch, batch_idx, optimizer_idx):
118 inputs = self.get_input(batch, self.image_key)

Callers 3

training_stepMethod · 0.95
_validation_stepMethod · 0.95
log_imagesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected