Spaces:
Running on Zero
Running on Zero
Upload diffcve/modules/diffusion/utils.py with huggingface_hub
Browse files
diffcve/modules/diffusion/utils.py
CHANGED
|
@@ -123,7 +123,10 @@ class SpatialTemporalConv(nn.Module):
|
|
| 123 |
|
| 124 |
def forward(self, inp, t=None):
|
| 125 |
bt, c, h, w = inp.shape
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
| 127 |
ori = inp
|
| 128 |
inp = from_4d_to_5d(inp, b, c, t, h, w)
|
| 129 |
res = self.temporal_conv(inp)
|
|
|
|
| 123 |
|
| 124 |
def forward(self, inp, t=None):
|
| 125 |
bt, c, h, w = inp.shape
|
| 126 |
+
# einops >= 0.4 raises when an explicit axis length is None (the authors'
|
| 127 |
+
# einops 0.3.0 inferred it from the shape); use the effective frame count.
|
| 128 |
+
t = t or self.num_frames
|
| 129 |
+
b = bt // t
|
| 130 |
ori = inp
|
| 131 |
inp = from_4d_to_5d(inp, b, c, t, h, w)
|
| 132 |
res = self.temporal_conv(inp)
|