Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

update stdit dtype (#392)

Zheng Zangwei (Alex Zheng)3893af0a62d9
diff --git a/opensora/models/stdit/stdit.py b/opensora/models/stdit/stdit.py
index 6882572..0bb3d5d 100644
--- a/opensora/models/stdit/stdit.py
+++ b/opensora/models/stdit/stdit.py
@@ -267,10 +267,10 @@ class STDiT(nn.Module):
Returns:
x (torch.Tensor): output latent representation; of shape [B, C, T, H, W]
"""
-
- x = x.to(self.dtype)
- timestep = timestep.to(self.dtype)
- y = y.to(self.dtype)
+ dtype = self.x_embedder.proj.weight.dtype
+ x = x.to(dtype)
+ timestep = timestep.to(dtype)
+ y = y.to(dtype)
# embedding
x = self.x_embedder(x) # [B, N, C]