mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-19 04:23:05 +03:00
* Switch from own memory class to cymem, in pip
This commit is contained in:
parent
6266cac593
commit
ac522e2553
|
@ -1,5 +1,6 @@
|
||||||
cython
|
cython
|
||||||
fabric
|
fabric
|
||||||
|
cymem
|
||||||
pytest
|
pytest
|
||||||
sphinx
|
sphinx
|
||||||
sphinxcontrib-napoleon
|
sphinxcontrib-napoleon
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -56,8 +56,6 @@ exts = [
|
||||||
include_dirs=includes),
|
include_dirs=includes),
|
||||||
Extension("spacy.tokens", ["spacy/tokens.pyx"], language="c++",
|
Extension("spacy.tokens", ["spacy/tokens.pyx"], language="c++",
|
||||||
include_dirs=includes),
|
include_dirs=includes),
|
||||||
Extension("spacy.memory", ["spacy/memory.pyx"], language="c++",
|
|
||||||
include_dirs=includes)
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from libc.stdint cimport uint64_t
|
from libc.stdint cimport uint64_t
|
||||||
from .memory cimport Address
|
from cymem.cymem cimport Address
|
||||||
|
|
||||||
ctypedef uint64_t key_t
|
ctypedef uint64_t key_t
|
||||||
ctypedef void* val_t
|
ctypedef void* val_t
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# cython: profile=True
|
# cython: profile=True
|
||||||
from .memory cimport Address
|
from cymem.cymem cimport Address
|
||||||
cimport cython
|
cimport cython
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ from spacy.tokens cimport Tokens
|
||||||
from spacy.lexeme cimport LexemeC
|
from spacy.lexeme cimport LexemeC
|
||||||
from spacy._hashing cimport PointerHash
|
from spacy._hashing cimport PointerHash
|
||||||
|
|
||||||
from spacy.memory cimport Pool
|
from cymem.cymem cimport Pool
|
||||||
|
|
||||||
from libcpp.utility cimport pair
|
from libcpp.utility cimport pair
|
||||||
from libcpp.vector cimport vector
|
from libcpp.vector cimport vector
|
||||||
|
|
|
@ -19,7 +19,7 @@ from murmurhash.mrmr cimport hash64
|
||||||
|
|
||||||
from cpython.ref cimport Py_INCREF
|
from cpython.ref cimport Py_INCREF
|
||||||
|
|
||||||
from .memory cimport Pool
|
from cymem.cymem cimport Pool
|
||||||
|
|
||||||
from cython.operator cimport preincrement as preinc
|
from cython.operator cimport preincrement as preinc
|
||||||
from cython.operator cimport dereference as deref
|
from cython.operator cimport dereference as deref
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from .typedefs cimport hash_t, utf8_t, flag_t, id_t
|
from .typedefs cimport hash_t, utf8_t, flag_t, id_t
|
||||||
from .memory cimport Pool
|
from cymem.cymem cimport Pool
|
||||||
|
|
||||||
|
|
||||||
cdef struct LexemeC:
|
cdef struct LexemeC:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from cpython.ref cimport Py_INCREF
|
from cpython.ref cimport Py_INCREF
|
||||||
from .memory cimport Pool
|
from cymem.cymem cimport Pool
|
||||||
|
|
||||||
|
|
||||||
cdef LexemeC* lexeme_init(Pool mem, unicode string, double prob, size_t cluster,
|
cdef LexemeC* lexeme_init(Pool mem, unicode string, double prob, size_t cluster,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
from libcpp.vector cimport vector
|
from libcpp.vector cimport vector
|
||||||
|
from cymem.cymem cimport Pool
|
||||||
|
|
||||||
cdef class Pool:
|
cdef class _Pool:
|
||||||
cdef vector[void*] _addresses
|
cdef vector[void*] _addresses
|
||||||
|
|
||||||
cdef void* alloc(self, size_t number, size_t size) except NULL
|
cdef void* alloc(self, size_t number, size_t size) except NULL
|
||||||
|
|
|
@ -3,6 +3,8 @@ from libc.string cimport memset
|
||||||
|
|
||||||
from libcpp.vector cimport vector
|
from libcpp.vector cimport vector
|
||||||
|
|
||||||
|
from cymem cimport Pool
|
||||||
|
|
||||||
|
|
||||||
cdef class Pool:
|
cdef class Pool:
|
||||||
def __cinit__(self):
|
def __cinit__(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user