mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-31 07:57:35 +03:00 
			
		
		
		
	Try to fix compile error on Windows
This commit is contained in:
		
							parent
							
								
									698fc0d016
								
							
						
					
					
						commit
						3274b46a0d
					
				|  | @ -419,21 +419,23 @@ cdef class Parser: | ||||||
|         c_token_ids = <int*>token_ids.data |         c_token_ids = <int*>token_ids.data | ||||||
|         c_is_valid = <int*>is_valid.data |         c_is_valid = <int*>is_valid.data | ||||||
|         cdef int has_hidden = not getattr(vec2scores, 'is_noop', False) |         cdef int has_hidden = not getattr(vec2scores, 'is_noop', False) | ||||||
|  |         cdef int nr_step | ||||||
|         while not next_step.empty(): |         while not next_step.empty(): | ||||||
|  |             nr_step = next_step.size() | ||||||
|             if not has_hidden: |             if not has_hidden: | ||||||
|                 for i in cython.parallel.prange( |                 for i in cython.parallel.prange(nr_step, num_threads=6, | ||||||
|                         next_step.size(), num_threads=6, nogil=True): |                                                 nogil=True): | ||||||
|                     self._parse_step(next_step[i], |                     self._parse_step(next_step[i], | ||||||
|                         feat_weights, nr_class, nr_feat, nr_piece) |                         feat_weights, nr_class, nr_feat, nr_piece) | ||||||
|             else: |             else: | ||||||
|                 for i in range(next_step.size()): |                 for i in range(nr_step): | ||||||
|                     st = next_step[i] |                     st = next_step[i] | ||||||
|                     st.set_context_tokens(&c_token_ids[i*nr_feat], nr_feat) |                     st.set_context_tokens(&c_token_ids[i*nr_feat], nr_feat) | ||||||
|                     self.moves.set_valid(&c_is_valid[i*nr_class], st) |                     self.moves.set_valid(&c_is_valid[i*nr_class], st) | ||||||
|                 vectors = state2vec(token_ids[:next_step.size()]) |                 vectors = state2vec(token_ids[:next_step.size()]) | ||||||
|                 scores = vec2scores(vectors) |                 scores = vec2scores(vectors) | ||||||
|                 c_scores = <float*>scores.data |                 c_scores = <float*>scores.data | ||||||
|                 for i in range(next_step.size()): |                 for i in range(nr_step): | ||||||
|                     st = next_step[i] |                     st = next_step[i] | ||||||
|                     guess = arg_max_if_valid( |                     guess = arg_max_if_valid( | ||||||
|                         &c_scores[i*nr_class], &c_is_valid[i*nr_class], nr_class) |                         &c_scores[i*nr_class], &c_is_valid[i*nr_class], nr_class) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user