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
1 changed files with 18 additions and 2 deletions

View File

@ -170,10 +170,15 @@ p
+aside-code("Example").
import spacy
spacy.prefer_gpu() # or: spacy.require_gpu()
activated = spacy.prefer_gpu()
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
+tag function
+tag-new("2.0.14")
@ -183,3 +188,14 @@ p
| 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
| 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]