mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Add test for vector resizing, re Issue #544
This commit is contained in:
parent
016cd5ab01
commit
e7af75e0a9
12
spacy/tests/vocab/test_add_vectors.py
Normal file
12
spacy/tests/vocab/test_add_vectors.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
import numpy
|
||||
|
||||
import spacy.en
|
||||
|
||||
|
||||
def test_add_vector():
|
||||
vocab = spacy.en.English.Defaults.create_vocab()
|
||||
vocab.resize_vectors(10)
|
||||
lex = vocab[u'Hello']
|
||||
lex.vector = numpy.ndarray((10,), dtype='float32')
|
||||
lex = vocab[u'Hello']
|
||||
assert lex.vector.shape == (10,)
|
Loading…
Reference in New Issue
Block a user