"src/vscode:/vscode.git/clone" did not exist on "07f95503e5b3e1823a5183d5999f4cb299becd19"
Unverified Commit 3e69e241 authored by Seongbin Lim's avatar Seongbin Lim Committed by GitHub
Browse files

Allow DDPMPipeline half precision (#9222)


Co-authored-by: default avatarYiYi Xu <yixu310@gmail.com>
parent 65f9439b
......@@ -101,10 +101,10 @@ class DDPMPipeline(DiffusionPipeline):
if self.device.type == "mps":
# randn does not work reproducibly on mps
image = randn_tensor(image_shape, generator=generator)
image = randn_tensor(image_shape, generator=generator, dtype=self.unet.dtype)
image = image.to(self.device)
else:
image = randn_tensor(image_shape, generator=generator, device=self.device)
image = randn_tensor(image_shape, generator=generator, device=self.device, dtype=self.unet.dtype)
# set step values
self.scheduler.set_timesteps(num_inference_steps)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment