mirror of
https://github.com/modelscope/modelscope.git
synced 2026-07-11 21:09:08 +02:00
Correct DDIM sampling on GPU (#173)
This commit is contained in:
committed by
GitHub
parent
a338f74489
commit
2bf4ead3fb
@@ -40,6 +40,7 @@ def discretized_gaussian_log_likelihood(x0, mean, log_scale):
|
||||
|
||||
|
||||
def _i(tensor, t, x):
|
||||
tensor = tensor.to(x.device)
|
||||
shape = (x.size(0), ) + (1, ) * (x.ndim - 1)
|
||||
return tensor[t].view(shape).to(x)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user