Update prefer_gpu and require_gpu docs [ci skip]

This commit is contained in:
Ines Montani 2018-10-14 23:30:44 +02:00
parent b305b24c24
commit f02bb08f39

View File

@ -170,10 +170,15 @@ p
+aside-code("Example"). +aside-code("Example").
import spacy import spacy
activated = spacy.prefer_gpu()
spacy.prefer_gpu() # or: spacy.require_gpu()
nlp = spacy.load('en_core_web_sm') nlp = spacy.load('en_core_web_sm')
+table(["Name", "Type", "Description"])
+row("foot")
+cell returns
+cell bool
+cell Whether the GPU was activated.
+h(3, "spacy.require_gpu") spacy.require_gpu +h(3, "spacy.require_gpu") spacy.require_gpu
+tag function +tag function
+tag-new("2.0.14") +tag-new("2.0.14")
@ -183,3 +188,14 @@ p
| raise an error if no GPU is available. If data has already been allocated | raise an error if no GPU is available. If data has already been allocated
| on CPU, it will not be moved. Ideally, this function should be called | on CPU, it will not be moved. Ideally, this function should be called
| right after importing spaCy and #[em before] loading any models. | right after importing spaCy and #[em before] loading any models.
+aside-code("Example").
import spacy
spacy.require_gpu()
nlp = spacy.load('en_core_web_sm')
+table(["Name", "Type", "Description"])
+row("foot")
+cell returns
+cell bool
+cell #[code True]