"torchvision/vscode:/vscode.git/clone" did not exist on "be798eff3f1255f647d56b7c245bdd8f4652e0a7"
utils.py 448 Bytes
Newer Older
1
import pytest
2
3
4
5
6
7
import backend as F

if F._default_context_str == 'cpu':
    parametrize_dtype = pytest.mark.parametrize("idtype", [F.int32, F.int64])
else:
    # only test int32 on GPU because many graph operators are not supported for int64.
8
    parametrize_dtype = pytest.mark.parametrize("idtype", [F.int32, F.int64])
9
10
11
12
13
14
15

def check_fail(fn, *args, **kwargs):
    try:
        fn(*args, **kwargs)
        return False
    except:
        return True