-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import pytest | ||
import torch.cuda | ||
import torch.version | ||
|
||
from tiktorch.server.device_pool import TorchDevicePool | ||
|
||
|
||
@pytest.mark.skipif(not torch.cuda.is_available(), reason="cuda is not available") | ||
def test_device_pool_with_cuda(): | ||
device_pool = TorchDevicePool() | ||
assert device_pool.cuda_version == torch.version.cuda | ||
|
||
|
||
@pytest.mark.skipif(torch.cuda.is_available(), reason="cuda is avaible") | ||
def test_device_pool_without_cuda(): | ||
device_pool = TorchDevicePool() | ||
assert device_pool.cuda_version is None |
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