File: test_issue208.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-- 328 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
from thinc.api import Linear, chain


def test_issue208():
    """Test issue that was caused by trying to flatten nested chains."""
    layer1 = Linear(nO=9, nI=3)
    layer2 = Linear(nO=12, nI=9)
    layer3 = Linear(nO=5, nI=12)
    model = chain(layer1, chain(layer2, layer3)).initialize()
    assert model.get_dim("nO") == 5