x-transformers 1.42.19__tar.gz → 1.42.20__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {x_transformers-1.42.19/x_transformers.egg-info → x_transformers-1.42.20}/PKG-INFO +1 -1
- {x_transformers-1.42.19 → x_transformers-1.42.20}/setup.py +1 -1
- {x_transformers-1.42.19 → x_transformers-1.42.20}/tests/test_x_transformers.py +7 -3
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/attend.py +1 -1
- {x_transformers-1.42.19 → x_transformers-1.42.20/x_transformers.egg-info}/PKG-INFO +1 -1
- {x_transformers-1.42.19 → x_transformers-1.42.20}/LICENSE +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/README.md +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/setup.cfg +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/__init__.py +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/autoregressive_wrapper.py +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/continuous.py +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/dpo.py +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/multi_input.py +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/neo_mlp.py +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/nonautoregressive_wrapper.py +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/x_transformers.py +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/xl_autoregressive_wrapper.py +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/xval.py +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers.egg-info/SOURCES.txt +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers.egg-info/dependency_links.txt +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers.egg-info/requires.txt +0 -0
- {x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers.egg-info/top_level.txt +0 -0
@@ -388,7 +388,8 @@ def test_neo_mlp():
|
|
388
388
|
out = mlp(x)
|
389
389
|
assert out.shape == (3, 7)
|
390
390
|
|
391
|
-
|
391
|
+
@pytest.mark.parametrize('flash', (True, False))
|
392
|
+
def test_custom_alibi(flash: bool):
|
392
393
|
|
393
394
|
model = TransformerWrapper(
|
394
395
|
num_tokens = 20_000,
|
@@ -397,7 +398,8 @@ def test_custom_alibi():
|
|
397
398
|
dim = 512,
|
398
399
|
depth = 2,
|
399
400
|
heads = 8,
|
400
|
-
alibi_pos_bias = True
|
401
|
+
alibi_pos_bias = True,
|
402
|
+
attn_flash = flash
|
401
403
|
)
|
402
404
|
)
|
403
405
|
|
@@ -407,7 +409,8 @@ def test_custom_alibi():
|
|
407
409
|
|
408
410
|
logits = model(x, pos = pos)
|
409
411
|
|
410
|
-
|
412
|
+
@pytest.mark.parametrize('flash', (True, False))
|
413
|
+
def test_custom_alibi_across_heads(flash: bool):
|
411
414
|
|
412
415
|
model = Decoder(
|
413
416
|
dim = 512,
|
@@ -417,6 +420,7 @@ def test_custom_alibi_across_heads():
|
|
417
420
|
rel_pos_kwargs = dict(
|
418
421
|
slopes = [1, 1]
|
419
422
|
),
|
423
|
+
attn_flash = flash
|
420
424
|
)
|
421
425
|
|
422
426
|
x = torch.randn(2, 4, 512)
|
@@ -370,7 +370,7 @@ class Attend(Module):
|
|
370
370
|
# convert from bool to float
|
371
371
|
|
372
372
|
if exists(attn_bias):
|
373
|
-
attn_bias =
|
373
|
+
attn_bias = attn_bias.expand(batch, heads, -1, -1)
|
374
374
|
|
375
375
|
# if mask given, the mask would already contain the causal mask from above logic
|
376
376
|
# otherwise, if no mask given but still causal, mask out alibi positional bias to a large negative number
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/nonautoregressive_wrapper.py
RENAMED
File without changes
|
File without changes
|
{x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers/xl_autoregressive_wrapper.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{x_transformers-1.42.19 → x_transformers-1.42.20}/x_transformers.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|