Update util/pos_embed.py
Browse files- util/pos_embed.py +1 -1
util/pos_embed.py
CHANGED
@@ -53,7 +53,7 @@ def get_1d_sincos_pos_embed_from_grid(embed_dim, pos):
|
|
53 |
out: (M, D)
|
54 |
"""
|
55 |
assert embed_dim % 2 == 0
|
56 |
-
omega = np.arange(embed_dim // 2, dtype=np.
|
57 |
omega /= embed_dim / 2.
|
58 |
omega = 1. / 10000**omega # (D/2,)
|
59 |
|
|
|
53 |
out: (M, D)
|
54 |
"""
|
55 |
assert embed_dim % 2 == 0
|
56 |
+
omega = np.arange(embed_dim // 2, dtype=np.float32)
|
57 |
omega /= embed_dim / 2.
|
58 |
omega = 1. / 10000**omega # (D/2,)
|
59 |
|