-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pin vectors to the CPU after deserialization (#157)
* Pin vectors to the CPU after deserialization * Restore CPU ops after regression test * Skip test if GPU support is not present * Use `use_ops` context manager in test * Typo
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from pathlib import Path | ||
import pytest | ||
from sense2vec.sense2vec import Sense2Vec | ||
from thinc.api import use_ops | ||
from thinc.util import has_cupy_gpu | ||
|
||
|
||
@pytest.mark.skipif(not has_cupy_gpu, reason="requires Cupy/GPU") | ||
def test_issue155(): | ||
data_path = Path(__file__).parent / "data" | ||
with use_ops("cupy"): | ||
s2v = Sense2Vec().from_disk(data_path) | ||
s2v.most_similar("beekeepers|NOUN") |