mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
Update get_cuda_stream
This commit is contained in:
parent
25280b7013
commit
92c26a35d4
|
@ -14,6 +14,7 @@ from collections import OrderedDict
|
||||||
import inspect
|
import inspect
|
||||||
import warnings
|
import warnings
|
||||||
from thinc.neural._classes.model import Model
|
from thinc.neural._classes.model import Model
|
||||||
|
from thinc.neural.ops import NumpyOps
|
||||||
import functools
|
import functools
|
||||||
import cytoolz
|
import cytoolz
|
||||||
import itertools
|
import itertools
|
||||||
|
@ -241,7 +242,12 @@ def is_in_jupyter():
|
||||||
|
|
||||||
|
|
||||||
def get_cuda_stream(require=False):
|
def get_cuda_stream(require=False):
|
||||||
return CudaStream() if CudaStream is not None else None
|
if CudaStream is None:
|
||||||
|
return None
|
||||||
|
elif isinstance(Model.ops, NumpyOps):
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
return CudaStream()
|
||||||
|
|
||||||
|
|
||||||
def get_async(stream, numpy_array):
|
def get_async(stream, numpy_array):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user