mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 18:56:36 +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