MCPcopy Create free account
hub / github.com/Trustworthy-AI-Group/TransferAttack / init_latent

Function init_latent

transferattack/generation/diffattack.py:636–638  ·  view source on GitHub ↗
(latent, model, height, width, batch_size)

Source from the content-addressed store, hash-verified

634
635
636def init_latent(latent, model, height, width, batch_size):
637 latents = latent.expand(batch_size, model.unet.in_channels, height // 8, width // 8).to(model.device)
638 return latent, latents
639
640
641def diffusion_step(model, latents, context, t, guidance_scale):

Callers 1

diffattackMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected