forked from easybuilders/easybuild-easyconfigs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PyTorch-1.8.0_correct-skip-tests-decorators.patch
109 lines (95 loc) · 3.89 KB
/
PyTorch-1.8.0_correct-skip-tests-decorators.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Based off https://github.com/pytorch/pytorch/pull/53736
Fixed to apply to PyTorch 1.8.0 by Simon Branford (University of Birmingham)
--- test/test_spectral_ops.py 2021-03-12 19:36:32.910758000 +0000
+++ test/test_spectral_ops.py 2021-03-12 19:41:42.314654931 +0000
@@ -185,6 +185,7 @@
with self.assertRaisesRegex(RuntimeError, match):
op(t)
+ @onlyOnCPUAndCUDA
def test_fft_invalid_dtypes(self, device):
t = torch.randn(64, device=device, dtype=torch.complex128)
@@ -599,7 +600,6 @@
_test_complex((40, 60, 3, 80), 3, lambda x: x.transpose(2, 0).select(0, 2)[5:55, :, 10:])
_test_complex((30, 55, 50, 22), 3, lambda x: x[:, 3:53, 15:40, 1:21])
- @skipCUDAIfRocm
@skipCPUIfNoMkl
@onlyOnCPUAndCUDA
@dtypes(torch.double)
@@ -680,8 +680,8 @@
self.assertEqual(torch.backends.cuda.cufft_plan_cache.max_size, 11) # default is cuda:1
# passes on ROCm w/ python 2.7, fails w/ python 3.6
- @skipCUDAIfRocm
@skipCPUIfNoMkl
+ @onlyOnCPUAndCUDA
@dtypes(torch.double)
def test_stft(self, device, dtype):
if not TEST_LIBROSA:
@@ -712,9 +712,8 @@
else:
window = None
if expected_error is None:
- with self.maybeWarnsRegex(UserWarning, "stft with return_complex=False"):
- result = x.stft(n_fft, hop_length, win_length, window,
- center=center, return_complex=False)
+ result = x.stft(n_fft, hop_length, win_length, window,
+ center=center, return_complex=False)
# NB: librosa defaults to np.complex64 output, no matter what
# the input dtype
ref_result = librosa_stft(x, n_fft, hop_length, win_length, window, center)
@@ -748,7 +747,7 @@
_test((10,), 5, 4, win_sizes=(1, 1), expected_error=RuntimeError)
- @skipCUDAIfRocm
+ @onlyOnCPUAndCUDA
@skipCPUIfNoMkl
@dtypes(torch.double, torch.cdouble)
def test_complex_stft_roundtrip(self, device, dtype):
@@ -790,7 +789,7 @@
length=x.size(-1), **common_kwargs)
self.assertEqual(x_roundtrip, x)
- @skipCUDAIfRocm
+ @onlyOnCPUAndCUDA
@skipCPUIfNoMkl
@dtypes(torch.double, torch.cdouble)
def test_stft_roundtrip_complex_window(self, device, dtype):
@@ -831,6 +830,7 @@
self.assertEqual(x_roundtrip, x)
+ @onlyOnCPUAndCUDA
@skipCUDAIfRocm
@skipCPUIfNoMkl
@dtypes(torch.cdouble)
@@ -851,7 +851,7 @@
actual = torch.stft(*args, window=window, center=False)
self.assertEqual(actual, expected)
- @skipCUDAIfRocm
+ @onlyOnCPUAndCUDA
@skipCPUIfNoMkl
@dtypes(torch.cdouble)
def test_complex_stft_real_equiv(self, device, dtype):
@@ -885,6 +885,7 @@
center=center, normalized=normalized)
self.assertEqual(expected, actual)
+ @onlyOnCPUAndCUDA
@skipCUDAIfRocm
@skipCPUIfNoMkl
@dtypes(torch.cdouble)
@@ -912,6 +913,7 @@
return_complex=True)
self.assertEqual(expected, actual)
+ @onlyOnCPUAndCUDA
@skipCUDAIfRocm
@skipCPUIfNoMkl
def test_complex_stft_onesided(self, device):
@@ -934,12 +936,15 @@
x.stft(10, pad_mode='constant', onesided=True)
# stft is currently warning that it requires return-complex while an upgrader is written
+ @onlyOnCPUAndCUDA
+ @skipCPUIfNoMkl
def test_stft_requires_complex(self, device):
x = torch.rand(100)
y = x.stft(10, pad_mode='constant')
# with self.assertRaisesRegex(RuntimeError, 'stft requires the return_complex parameter'):
# y = x.stft(10, pad_mode='constant')
+ @onlyOnCPUAndCUDA
@skipCUDAIfRocm
@skipCPUIfNoMkl
def test_fft_input_modification(self, device):