1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

update tests

This commit is contained in:
Jack Morris
2020-05-09 08:42:34 -04:00
parent f847e4c472
commit a4f72facbd
11 changed files with 267 additions and 43 deletions

View File

@@ -11,7 +11,6 @@ def register_test(function, name=None, output_file=None, desc=None):
function, name=name, output=output, desc=desc
))
#######################################
## BEGIN TESTS ##
#######################################
@@ -23,7 +22,7 @@ def check_gpu_count():
import torch
num_gpus = torch.cuda.device_count()
if num_gpus == 0:
print(f'Error: detected 0 GPUs. Must run local tests with multiple GPUs. Perhaps you need to configure CUDA?')
raise ValueError(f'detected 0 GPUs. Must run local tests with multiple GPUs. Perhaps you need to configure CUDA?')
register_test(check_gpu_count, name='check CUDA',
output_file='local_tests/sample_outputs/empty_file.txt',