MCPcopy Create free account
hub / github.com/ChenWu98/cycle-diffusion / get_condition

Function get_condition

model/gan_wrapper/latentdiff_wrapper.py:58–66  ·  view source on GitHub ↗
(model, class_label, bs)

Source from the content-addressed store, hash-verified

56
57
58def get_condition(model, class_label, bs):
59 uc = model.get_learned_conditioning(
60 {model.cond_stage_key: torch.tensor(bs * [1000]).to(model.device)}
61 )
62 print("model.cond_stage_key: ", model.cond_stage_key)
63 c = model.get_learned_conditioning({model.cond_stage_key: class_label})
64 print("c.shape: ", c.shape)
65 print('-' * 50)
66 return c, uc
67
68
69def convsample_ddim_conditional(model, steps, shape, x_T, eta, scale, class_label):

Calls 1

Tested by

no test coverage detected