mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-04 20:30:24 +03:00
Update for CBlas changes in Thinc 8.1.0.dev2
Bump thinc dependency to 8.1.0.dev3.
This commit is contained in:
parent
0fc07343e4
commit
8fceabd563
|
@ -5,7 +5,7 @@ requires = [
|
||||||
"cymem>=2.0.2,<2.1.0",
|
"cymem>=2.0.2,<2.1.0",
|
||||||
"preshed>=3.0.2,<3.1.0",
|
"preshed>=3.0.2,<3.1.0",
|
||||||
"murmurhash>=0.28.0,<1.1.0",
|
"murmurhash>=0.28.0,<1.1.0",
|
||||||
"thinc>=8.1.0.dev0,<8.2.0",
|
"thinc>=8.1.0.dev3,<8.2.0",
|
||||||
"pathy",
|
"pathy",
|
||||||
"numpy>=1.15.0",
|
"numpy>=1.15.0",
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,7 +3,7 @@ spacy-legacy>=3.0.9,<3.1.0
|
||||||
spacy-loggers>=1.0.0,<2.0.0
|
spacy-loggers>=1.0.0,<2.0.0
|
||||||
cymem>=2.0.2,<2.1.0
|
cymem>=2.0.2,<2.1.0
|
||||||
preshed>=3.0.2,<3.1.0
|
preshed>=3.0.2,<3.1.0
|
||||||
thinc>=8.1.0.dev0,<8.2.0
|
thinc>=8.1.0.dev3,<8.2.0
|
||||||
ml_datasets>=0.2.0,<0.3.0
|
ml_datasets>=0.2.0,<0.3.0
|
||||||
murmurhash>=0.28.0,<1.1.0
|
murmurhash>=0.28.0,<1.1.0
|
||||||
wasabi>=0.9.1,<1.1.0
|
wasabi>=0.9.1,<1.1.0
|
||||||
|
|
|
@ -38,7 +38,7 @@ setup_requires =
|
||||||
cymem>=2.0.2,<2.1.0
|
cymem>=2.0.2,<2.1.0
|
||||||
preshed>=3.0.2,<3.1.0
|
preshed>=3.0.2,<3.1.0
|
||||||
murmurhash>=0.28.0,<1.1.0
|
murmurhash>=0.28.0,<1.1.0
|
||||||
thinc>=8.1.0.dev0,<8.2.0
|
thinc>=8.1.0.dev3,<8.2.0
|
||||||
install_requires =
|
install_requires =
|
||||||
# Our libraries
|
# Our libraries
|
||||||
spacy-legacy>=3.0.9,<3.1.0
|
spacy-legacy>=3.0.9,<3.1.0
|
||||||
|
@ -46,7 +46,7 @@ install_requires =
|
||||||
murmurhash>=0.28.0,<1.1.0
|
murmurhash>=0.28.0,<1.1.0
|
||||||
cymem>=2.0.2,<2.1.0
|
cymem>=2.0.2,<2.1.0
|
||||||
preshed>=3.0.2,<3.1.0
|
preshed>=3.0.2,<3.1.0
|
||||||
thinc>=8.1.0.dev0,<8.2.0
|
thinc>=8.1.0.dev3,<8.2.0
|
||||||
wasabi>=0.9.1,<1.1.0
|
wasabi>=0.9.1,<1.1.0
|
||||||
srsly>=2.4.3,<3.0.0
|
srsly>=2.4.3,<3.0.0
|
||||||
catalogue>=2.0.6,<2.1.0
|
catalogue>=2.0.6,<2.1.0
|
||||||
|
|
|
@ -9,7 +9,7 @@ from thinc.api import Model, normal_init, chain, list2array, Linear
|
||||||
from thinc.api import uniform_init, glorot_uniform_init, zero_init
|
from thinc.api import uniform_init, glorot_uniform_init, zero_init
|
||||||
from thinc.api import NumpyOps
|
from thinc.api import NumpyOps
|
||||||
from thinc.backends.linalg cimport Vec, VecVec
|
from thinc.backends.linalg cimport Vec, VecVec
|
||||||
from thinc.backends.cblas cimport CBlas
|
from thinc.backends.cblas cimport CBlas, saxpy, sgemm
|
||||||
from thinc.types import Floats1d, Floats2d, Floats3d, Floats4d
|
from thinc.types import Floats1d, Floats2d, Floats3d, Floats4d
|
||||||
from thinc.types import Ints1d, Ints2d
|
from thinc.types import Ints1d, Ints2d
|
||||||
|
|
||||||
|
@ -522,7 +522,7 @@ cdef void _predict_states(CBlas cblas, ActivationsC* A, float* scores, StateC**
|
||||||
memcpy(scores, A.hiddens, n.states * n.classes * sizeof(float))
|
memcpy(scores, A.hiddens, n.states * n.classes * sizeof(float))
|
||||||
else:
|
else:
|
||||||
# Compute hidden-to-output
|
# Compute hidden-to-output
|
||||||
cblas.sgemm()(False, True, n.states, n.classes, n.hiddens,
|
sgemm(cblas)(False, True, n.states, n.classes, n.hiddens,
|
||||||
1.0, <const float *>A.hiddens, n.hiddens,
|
1.0, <const float *>A.hiddens, n.hiddens,
|
||||||
<const float *>W.hidden_weights, n.hiddens,
|
<const float *>W.hidden_weights, n.hiddens,
|
||||||
0.0, scores, n.classes)
|
0.0, scores, n.classes)
|
||||||
|
@ -559,5 +559,5 @@ cdef void _sum_state_features(CBlas cblas, float* output,
|
||||||
else:
|
else:
|
||||||
idx = token_ids[f] * id_stride + f*O
|
idx = token_ids[f] * id_stride + f*O
|
||||||
feature = &cached[idx]
|
feature = &cached[idx]
|
||||||
cblas.saxpy()(O, one, <const float*>feature, 1, &output[b*O], 1)
|
saxpy(cblas)(O, one, <const float*>feature, 1, &output[b*O], 1)
|
||||||
token_ids += F
|
token_ids += F
|
||||||
|
|
Loading…
Reference in New Issue
Block a user