mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-25 12:39:25 +01:00
Fix device mismatch for text to video (#207)
This commit is contained in:
@@ -10,6 +10,7 @@ __all__ = ['GaussianDiffusion', 'beta_schedule']
|
||||
def _i(tensor, t, x):
|
||||
r"""Index tensor using t and format the output according to 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