This commit is contained in:
Ubuntu 2019-06-28 15:30:06 +00:00
Родитель 34ff971fc9
Коммит b493739e93
3 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -14,8 +14,7 @@ steps:
- bash: | - bash: |
source activate cv source activate cv
python -m ipykernel install --user --name cv --display-name "cv" python -m ipykernel install --user --name cv --display-name "cv"
pytest --durations 100 tests/unit --junitxml=junit/test-unitttest.xml pytest --durations 100 tests --junitxml=junit/test-unitttest.xml
pytest --durations 100 tests/integration --junitxml=junit/test-unitttest.xml
displayName: 'Run unit and (only on Linux GPU) integration tests' displayName: 'Run unit and (only on Linux GPU) integration tests'
- bash: | - bash: |

Просмотреть файл

@ -11,3 +11,12 @@ def which_processor():
print(f"Fast.ai (Torch) is using GPU: {get_device_name(device_nr)}") print(f"Fast.ai (Torch) is using GPU: {get_device_name(device_nr)}")
else: else:
print("Cuda is not available. Fast.ai/Torch is using CPU") print("Cuda is not available. Fast.ai/Torch is using CPU")
# Helper function to check if GPU machine which linux.
# Integration tests are too slow on Windows/CPU machines.
def linux_with_gpu():
"""Returns if machine is running an Linux OS and has a GPU"""
is_linux = platform.system().lower() == "linux"
has_gpu = is_available()
return is_linux and has_gpu