Fix model deserialization

This commit is contained in:
Matthew Honnibal 2017-05-29 14:46:31 -05:00
parent 5b29f227ae
commit 35d981241f

View File

@ -453,7 +453,9 @@ def model_from_bytes(model, bytes_data):
for layer in queue:
if hasattr(layer, '_mem'):
params = weights[i]
flat_mem = layer._mem._mem.ravel()
layer._mem._get_blob(params.size)
layer._mem._i -= params.size
flat_mem = layer._mem._mem.ravel()
flat_params = params.ravel()
flat_mem[:flat_params.size] = flat_params
layer._mem._offsets.update(metas[i])