mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 09:57:26 +03:00 
			
		
		
		
	* precompute_hiddens/Parser: look up CPU ops once * precompute_hiddens: make cpu_ops private
		
			
				
	
	
		
			22 lines
		
	
	
		
			740 B
		
	
	
	
		
			Cython
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			740 B
		
	
	
	
		
			Cython
		
	
	
	
	
	
from cymem.cymem cimport Pool
 | 
						|
from thinc.backends.cblas cimport CBlas
 | 
						|
 | 
						|
from ..vocab cimport Vocab
 | 
						|
from .trainable_pipe cimport TrainablePipe
 | 
						|
from ._parser_internals.transition_system cimport Transition, TransitionSystem
 | 
						|
from ._parser_internals._state cimport StateC
 | 
						|
from ..ml.parser_model cimport WeightsC, ActivationsC, SizesC
 | 
						|
 | 
						|
 | 
						|
cdef class Parser(TrainablePipe):
 | 
						|
    cdef public object _rehearsal_model
 | 
						|
    cdef readonly TransitionSystem moves
 | 
						|
    cdef public object _multitasks
 | 
						|
    cdef object _cpu_ops
 | 
						|
 | 
						|
    cdef void _parseC(self, CBlas cblas, StateC** states,
 | 
						|
            WeightsC weights, SizesC sizes) nogil
 | 
						|
 | 
						|
    cdef void c_transition_batch(self, StateC** states, const float* scores,
 | 
						|
            int nr_class, int batch_size) nogil
 |