mirror of
https://github.com/wassname/TTS.git
synced 2026-10-27 12:30:27 +08:00
bug fix for illegal memory reach
This commit is contained in:
1 parent
b9e0faca98
commit
695bf1a1f6
1 file changed
+1
-1
@@ -127,7 +127,7 @@ class GravesAttention(nn.Module):
|
||||
|
||||
def init_states(self, inputs):
|
||||
if self.J is None or inputs.shape[1] > self.J.shape[-1]:
|
||||
self.J = torch.arange(0, inputs.shape[1]).expand_as(torch.Tensor(inputs.shape[0], self.K, inputs.shape[1])).to(inputs.device)
|
||||
self.J = torch.arange(0, inputs.shape[1]).to(inputs.device).expand([inputs.shape[0], self.K, inputs.shape[1]])
|
||||
self.attention_weights = torch.zeros(inputs.shape[0], inputs.shape[1]).to(inputs.device)
|
||||
self.mu_prev = torch.zeros(inputs.shape[0], self.K).to(inputs.device)
|
||||
|
||||
|
||||
Reference in new issue
Block a user