linter and test updates for speaker_encoder, gmm_Attention

This commit is contained in:
Eren Golge
2019-11-12 12:42:42 +01:00
parent 1401a0db6b
commit df1b8b3ec7
14 changed files with 171 additions and 207 deletions
+5 -4
View File
@@ -136,6 +136,8 @@ class GravesAttention(nn.Module):
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)
# pylint: disable=R0201
# pylint: disable=unused-argument
def preprocess_inputs(self, inputs):
return None
@@ -376,8 +378,7 @@ def init_attn(attn_type, query_dim, embedding_dim, attention_dim,
attention_location_kernel_size, windowing,
norm, forward_attn, trans_agent,
forward_attn_mask)
elif attn_type == "graves":
if attn_type == "graves":
return GravesAttention(query_dim, attn_K)
else:
raise RuntimeError(
" [!] Given Attention Type '{attn_type}' is not exist.")
raise RuntimeError(
" [!] Given Attention Type '{attn_type}' is not exist.")