MCPcopy Create free account
hub / github.com/GuyTevet/motion-diffusion-model / forward

Method forward

model/cfg_sampler.py:25–32  ·  view source on GitHub ↗
(self, x, timesteps, y=None)

Source from the content-addressed store, hash-verified

23 self.encode_text = self.model.encode_text
24
25 def forward(self, x, timesteps, y=None):
26 cond_mode = self.model.cond_mode
27 assert cond_mode in ['text', 'action']
28 y_uncond = deepcopy(y)
29 y_uncond['uncond'] = True
30 out = self.model(x, timesteps, y)
31 out_uncond = self.model(x, timesteps, y_uncond)
32 return out_uncond + (y['scale'].view(-1, 1, 1, 1) * (out - out_uncond))
33

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected