Skip to content
Snippets Groups Projects
Commit 62c4b4ee authored by Caroline DE POURTALES's avatar Caroline DE POURTALES
Browse files

concatenation works

parent f10db470
Branches multibehavior
Tags
2 merge requests!6Linker with transformer,!5Linker with transformer
...@@ -21,5 +21,5 @@ class PositionalEncoding(nn.Module): ...@@ -21,5 +21,5 @@ class PositionalEncoding(nn.Module):
Args: Args:
x: Tensor, shape [batch_size,seq_len, embedding_dim] x: Tensor, shape [batch_size,seq_len, embedding_dim]
""" """
x = x + self.pe[:x.size(0)] x = x + self.pe[:, :x.size(1)]
return self.dropout(x) return self.dropout(x)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment