コード例 #1
0
def test_include_pairs(rng):
    v = Vocabulary(10, rng=rng)
    v["A"]
    v["B"]
    v["C"]
    assert v.key_pairs is None
    v.include_pairs = True
    assert v.key_pairs == ["A*B", "A*C", "B*C"]
    v.include_pairs = False
    assert v.key_pairs is None
    v.include_pairs = True
    v["D"]
    assert v.key_pairs == ["A*B", "A*C", "B*C", "A*D", "B*D", "C*D"]

    v = Vocabulary(12, include_pairs=True, rng=rng)
    v["A"]
    v["B"]
    v["C"]
    assert v.key_pairs == ["A*B", "A*C", "B*C"]
コード例 #2
0
ファイル: test_vocabulary.py プロジェクト: CamZHU/nengo
def test_include_pairs(rng):
    v = Vocabulary(10, rng=rng)
    v['A']
    v['B']
    v['C']
    assert v.key_pairs is None
    v.include_pairs = True
    assert v.key_pairs == ['A*B', 'A*C', 'B*C']
    v.include_pairs = False
    assert v.key_pairs is None
    v.include_pairs = True
    v['D']
    assert v.key_pairs == ['A*B', 'A*C', 'B*C', 'A*D', 'B*D', 'C*D']

    v = Vocabulary(12, include_pairs=True)
    v['A']
    v['B']
    v['C']
    assert v.key_pairs == ['A*B', 'A*C', 'B*C']
コード例 #3
0
ファイル: test_vocabulary.py プロジェクト: weizx208/nengo
def test_include_pairs(rng):
    v = Vocabulary(10, rng=rng)
    v['A']
    v['B']
    v['C']
    assert v.key_pairs is None
    v.include_pairs = True
    assert v.key_pairs == ['A*B', 'A*C', 'B*C']
    v.include_pairs = False
    assert v.key_pairs is None
    v.include_pairs = True
    v['D']
    assert v.key_pairs == ['A*B', 'A*C', 'B*C', 'A*D', 'B*D', 'C*D']

    v = Vocabulary(12, include_pairs=True, rng=rng)
    v['A']
    v['B']
    v['C']
    assert v.key_pairs == ['A*B', 'A*C', 'B*C']
コード例 #4
0
ファイル: test_vocabulary.py プロジェクト: qqming113/nengo
def test_include_pairs():
    v = Vocabulary(10)
    v["A"]
    v["B"]
    v["C"]
    assert v.key_pairs is None
    v.include_pairs = True
    assert v.key_pairs == ["A*B", "A*C", "B*C"]
    v.include_pairs = False
    assert v.key_pairs is None
    v.include_pairs = True
    v["D"]
    assert v.key_pairs == ["A*B", "A*C", "B*C", "A*D", "B*D", "C*D"]

    v = Vocabulary(12, include_pairs=True)
    v["A"]
    v["B"]
    v["C"]
    assert v.key_pairs == ["A*B", "A*C", "B*C"]