From bf4291f5fad6552b5f87a14e018e5a1bf0025347 Mon Sep 17 00:00:00 2001 From: Rogier van Dalen Date: Wed, 7 May 2025 18:19:29 +0100 Subject: [PATCH] Ensure that x is not unbound in WordEmbeddingEncoder --- speechbrain/lobes/models/g2p/model.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/speechbrain/lobes/models/g2p/model.py b/speechbrain/lobes/models/g2p/model.py index f7be0327f1..89cf683aea 100644 --- a/speechbrain/lobes/models/g2p/model.py +++ b/speechbrain/lobes/models/g2p/model.py @@ -193,8 +193,7 @@ def forward(self, emb): emb_enc: torch.Tensor encoded word embeddings """ - if self.norm is not None: - x = self.norm(emb) + x = emb if self.norm is None else self.norm(emb) x = self.lin(x) x = self.activation(x) return x