diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/util.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/util.py b/util/util.py index 65f1838..bb9e0c3 100644 --- a/util/util.py +++ b/util/util.py @@ -14,4 +14,4 @@ def get_positional_encoding(n_positions, n_dimensions, device='cpu'): positional_encoding[:, ::2] = torch.sin(positional_encoding[:, ::2]) positional_encoding[:, 1::2] = torch.cos(positional_encoding[:, 1::2]) # output shape: (seqlen, hiddendim) - return positional_encoding + return positional_encoding.to(device) |