Spaces:
Running
on
Zero
Running
on
Zero
Update cosyvoice/transformer/convolution.py
Browse files
cosyvoice/transformer/convolution.py
CHANGED
|
@@ -177,11 +177,12 @@ class CausalConv1d(torch.nn.Conv1d):
|
|
| 177 |
input_timestep = x.shape[2]
|
| 178 |
if cache.size(2) == 0:
|
| 179 |
cache = torch.zeros(x.shape[0], x.shape[1], self.causal_padding).to(x)
|
| 180 |
-
cache = cache.to(x)
|
| 181 |
assert cache.size(2) == self.causal_padding
|
| 182 |
if self.causal_type == 'left':
|
| 183 |
x = torch.concat([cache, x], dim=2)
|
| 184 |
else:
|
|
|
|
| 185 |
x = torch.concat([x, cache], dim=2)
|
| 186 |
x = super(CausalConv1d, self).forward(x)
|
| 187 |
assert x.shape[2] == input_timestep
|
|
|
|
| 177 |
input_timestep = x.shape[2]
|
| 178 |
if cache.size(2) == 0:
|
| 179 |
cache = torch.zeros(x.shape[0], x.shape[1], self.causal_padding).to(x)
|
| 180 |
+
cache = cache.to(x.device)
|
| 181 |
assert cache.size(2) == self.causal_padding
|
| 182 |
if self.causal_type == 'left':
|
| 183 |
x = torch.concat([cache, x], dim=2)
|
| 184 |
else:
|
| 185 |
+
print('x.device {} cache.device {}'.format(x.device, cache.device))
|
| 186 |
x = torch.concat([x, cache], dim=2)
|
| 187 |
x = super(CausalConv1d, self).forward(x)
|
| 188 |
assert x.shape[2] == input_timestep
|