Add warning message re Issue #3853

This commit is contained in:
Matthew Honnibal 2019-07-11 12:32:59 +02:00
parent d166756607
commit e19f4ee719

View File

@ -299,7 +299,14 @@ def link_vectors_to_models(vocab):
data = ops.asarray(vectors.data)
# Set an entry here, so that vectors are accessed by StaticVectors
# (unideal, I know)
thinc.extra.load_nlp.VECTORS[(ops.device, vectors.name)] = data
key = (ops.device, vectors.name)
if key in thinc.extra.load_nlp.VECTORS:
if thinc.extra.load_nlp.VECTORS[key].shape != data.shape:
print(
"Warning: Registering vectors data under the same ID as "
"existing vectors, and the new vectors data seems different. "
"This might lead to incorrect results. See Issue #3853")
thinc.extra.load_nlp.VECTORS[key] = data
def PyTorchBiLSTM(nO, nI, depth, dropout=0.2):