x-transformers 1.30.1__py3-none-any.whl → 1.30.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -468,7 +468,8 @@ def rotate_half(x):
468
468
 
469
469
  @autocast(enabled = False)
470
470
  def apply_rotary_pos_emb(t, freqs, scale = 1):
471
- rot_dim, seq_len = freqs.shape[-1], t.shape[-2]
471
+ rot_dim, seq_len, orig_dtype = freqs.shape[-1], t.shape[-2], t.dtype
472
+
472
473
  freqs = freqs[-seq_len:, :]
473
474
  scale = scale[-seq_len:, :] if isinstance(scale, torch.Tensor) else scale
474
475
 
@@ -478,7 +479,9 @@ def apply_rotary_pos_emb(t, freqs, scale = 1):
478
479
  # partial rotary embeddings, Wang et al. GPT-J
479
480
  t, t_unrotated = t[..., :rot_dim], t[..., rot_dim:]
480
481
  t = (t * freqs.cos() * scale) + (rotate_half(t) * freqs.sin() * scale)
481
- return torch.cat((t, t_unrotated), dim = -1)
482
+ out = torch.cat((t, t_unrotated), dim = -1)
483
+
484
+ return out.type(orig_dtype)
482
485
 
483
486
  # norms
484
487
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: x-transformers
3
- Version: 1.30.1
3
+ Version: 1.30.2
4
4
  Summary: X-Transformers - Pytorch
5
5
  Home-page: https://github.com/lucidrains/x-transformers
6
6
  Author: Phil Wang
@@ -4,11 +4,11 @@ x_transformers/autoregressive_wrapper.py,sha256=uX8Mb0zLsQrZECt_9UGt35g7tC05Rk3n
4
4
  x_transformers/continuous.py,sha256=WO52n9lFAXv5-SGadi2cApGF8dkouN8QSTEOuC7erj8,6180
5
5
  x_transformers/dpo.py,sha256=LjvWgCkqTl-UuehrzQ8nkX5guLr4whYwsmm7SKSwdls,3450
6
6
  x_transformers/nonautoregressive_wrapper.py,sha256=ys_p8obc7lTeeodCqvkRKxOXQ1C9T3j5Jwr-JbVgnXk,10432
7
- x_transformers/x_transformers.py,sha256=EEfqwI-NANzrQf10Tc_bRSdjWOIEJdhxOfzeKY4osyI,66137
7
+ x_transformers/x_transformers.py,sha256=uwooxffSXL2vTxLhDnkxF7fMe0gaCFW5WinuiR0fQpU,66191
8
8
  x_transformers/xl_autoregressive_wrapper.py,sha256=DCx4n0_c1tFai4nOqaWVnqx2p9eutsZsDMiMP1ckxNU,4117
9
9
  x_transformers/xval.py,sha256=QE1ltYZTR_eGgIHPP2BrMWVWVLqMW-OpDZh87BSmQEg,8563
10
- x_transformers-1.30.1.dist-info/LICENSE,sha256=As9u198X-U-vph5noInuUfqsAG2zX_oXPHDmdjwlPPY,1066
11
- x_transformers-1.30.1.dist-info/METADATA,sha256=gkmRLAvk0l9_vkrTVBIWLnFq_cEtCYrI8oI3B07d9B8,661
12
- x_transformers-1.30.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
13
- x_transformers-1.30.1.dist-info/top_level.txt,sha256=hO6KGpFuGucRNEtRfme4A_rGcM53AKwGP7RVlRIxS5Q,15
14
- x_transformers-1.30.1.dist-info/RECORD,,
10
+ x_transformers-1.30.2.dist-info/LICENSE,sha256=As9u198X-U-vph5noInuUfqsAG2zX_oXPHDmdjwlPPY,1066
11
+ x_transformers-1.30.2.dist-info/METADATA,sha256=ih2I-SzJQe_qASq_WzOwNuGKKrNTe5mvTba0ZrnMdfI,661
12
+ x_transformers-1.30.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
13
+ x_transformers-1.30.2.dist-info/top_level.txt,sha256=hO6KGpFuGucRNEtRfme4A_rGcM53AKwGP7RVlRIxS5Q,15
14
+ x_transformers-1.30.2.dist-info/RECORD,,