File: test_parametric_attention_v2.py

package info (click to toggle)
python-thinc 9.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,896 kB
  • sloc: python: 17,122; javascript: 1,559; ansic: 342; makefile: 15; sh: 13
file content (10 lines) | stat: -rw-r--r-- 285 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
from thinc.layers.gelu import Gelu
from thinc.layers.parametricattention_v2 import (
    KEY_TRANSFORM_REF,
    ParametricAttention_v2,
)


def test_key_transform_used():
    attn = ParametricAttention_v2(key_transform=Gelu())
    assert attn.get_ref(KEY_TRANSFORM_REF).name == "gelu"