MCPcopy Create free account
hub / github.com/TencentARC/MotionCtrl / get_input

Method get_input

lvdm/models/autoencoder.py:120–128  ·  view source on GitHub ↗
(self, batch, k)

Source from the content-addressed store, hash-verified

118 return dec, posterior
119
120 def get_input(self, batch, k):
121 x = batch[k]
122 if x.dim() == 5 and self.input_dim == 4:
123 b,c,t,h,w = x.shape
124 self.b = b
125 self.t = t
126 x = rearrange(x, 'b c t h w -> (b t) c h w')
127
128 return x
129
130 def training_step(self, batch, batch_idx, optimizer_idx):
131 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