Skip to content

Commit

Permalink
Update to new torch autocast
Browse files Browse the repository at this point in the history
  • Loading branch information
corystephenson-db committed Oct 4, 2024
1 parent a004a9d commit 1e2c20c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diffusion/models/precomputed_text_latent_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def set_rng_generator(self, rng_generator: torch.Generator):
self.rng_generator = rng_generator

def encode_images(self, inputs, dtype=torch.bfloat16):
with torch.amp.autocast('cuda', enabled=False):
with torch.autocast(device_type='cuda', enabled=False):
latents = self.vae.encode(inputs.to(dtype))['latent_dist'].sample().data
latents = (latents - self.latent_mean) / self.latent_std # scale latents
return latents
Expand Down

0 comments on commit 1e2c20c

Please sign in to comment.