We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29f70e7 commit d3f9c83Copy full SHA for d3f9c83
src/lightning/pytorch/demos/transformer.py
@@ -88,7 +88,7 @@ def forward(self, x: Tensor) -> Tensor:
88
# TODO: Could make this a `nn.Parameter` with `requires_grad=False`
89
self.pe = self._init_pos_encoding(device=x.device)
90
91
- x + self.pe[: x.size(0), :]
+ x = x + self.pe[: x.size(0), :]
92
return self.dropout(x)
93
94
def _init_pos_encoding(self, device: torch.device) -> Tensor:
0 commit comments