mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Update prefer_gpu and require_gpu docs [ci skip]
This commit is contained in:
parent
b305b24c24
commit
f02bb08f39
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue
Block a user