@@ -724,7 +724,6 @@ def test_repr(self):
724
724
dist = Dist (** param )
725
725
self .assertTrue (repr (dist ).startswith (dist .__class__ .__name__ ))
726
726
727
- @skipIfRocm
728
727
def test_sample_detached (self ):
729
728
for Dist , params in EXAMPLES :
730
729
for i , param in enumerate (params ):
@@ -737,7 +736,6 @@ def test_sample_detached(self):
737
736
msg = '{} example {}/{}, .sample() is not detached' .format (
738
737
Dist .__name__ , i + 1 , len (params )))
739
738
740
- @skipIfRocm
741
739
def test_rsample_requires_grad (self ):
742
740
for Dist , params in EXAMPLES :
743
741
for i , param in enumerate (params ):
@@ -751,7 +749,6 @@ def test_rsample_requires_grad(self):
751
749
msg = '{} example {}/{}, .rsample() does not require grad' .format (
752
750
Dist .__name__ , i + 1 , len (params )))
753
751
754
- @skipIfRocm
755
752
def test_enumerate_support_type (self ):
756
753
for Dist , params in EXAMPLES :
757
754
for i , param in enumerate (params ):
@@ -763,7 +760,6 @@ def test_enumerate_support_type(self):
763
760
except NotImplementedError :
764
761
pass
765
762
766
- @skipIfRocm
767
763
def test_lazy_property_grad (self ):
768
764
x = torch .randn (1 , requires_grad = True )
769
765
@@ -1541,7 +1537,6 @@ def test_normal_sample(self):
1541
1537
scipy .stats .norm (loc = loc , scale = scale ),
1542
1538
'Normal(mean={}, std={})' .format (loc , scale ))
1543
1539
1544
- @skipIfRocm
1545
1540
def test_lowrank_multivariate_normal_shape (self ):
1546
1541
mean = torch .randn (5 , 3 , requires_grad = True )
1547
1542
mean_no_batch = torch .randn (3 , requires_grad = True )
@@ -1590,7 +1585,6 @@ def test_lowrank_multivariate_normal_shape(self):
1590
1585
(mean_multi_batch , cov_factor_batched , cov_diag_batched ))
1591
1586
1592
1587
@unittest .skipIf (not TEST_NUMPY , "Numpy not found" )
1593
- @skipIfRocm
1594
1588
def test_lowrank_multivariate_normal_log_prob (self ):
1595
1589
mean = torch .randn (3 , requires_grad = True )
1596
1590
cov_factor = torch .randn (3 , 1 , requires_grad = True )
@@ -1624,7 +1618,6 @@ def test_lowrank_multivariate_normal_log_prob(self):
1624
1618
self .assertAlmostEqual (0.0 , (batched_prob - unbatched_prob ).abs ().max (), places = 3 )
1625
1619
1626
1620
@unittest .skipIf (not TEST_NUMPY , "NumPy not found" )
1627
- @skipIfRocm
1628
1621
def test_lowrank_multivariate_normal_sample (self ):
1629
1622
set_rng_seed (0 ) # see Note [Randomized statistical tests]
1630
1623
mean = torch .randn (5 , requires_grad = True )
@@ -1637,7 +1630,6 @@ def test_lowrank_multivariate_normal_sample(self):
1637
1630
'LowRankMultivariateNormal(loc={}, cov_factor={}, cov_diag={})'
1638
1631
.format (mean , cov_factor , cov_diag ), multivariate = True )
1639
1632
1640
- @skipIfRocm
1641
1633
def test_lowrank_multivariate_normal_properties (self ):
1642
1634
loc = torch .randn (5 )
1643
1635
cov_factor = torch .randn (5 , 2 )
@@ -1652,7 +1644,6 @@ def test_lowrank_multivariate_normal_properties(self):
1652
1644
self .assertEqual (m1 .precision_matrix , m2 .precision_matrix )
1653
1645
self .assertEqual (m1 .entropy (), m2 .entropy ())
1654
1646
1655
- @skipIfRocm
1656
1647
def test_lowrank_multivariate_normal_moments (self ):
1657
1648
set_rng_seed (0 ) # see Note [Randomized statistical tests]
1658
1649
mean = torch .randn (5 )
@@ -1665,7 +1656,6 @@ def test_lowrank_multivariate_normal_moments(self):
1665
1656
empirical_var = samples .var (0 )
1666
1657
self .assertEqual (d .variance , empirical_var , prec = 0.02 )
1667
1658
1668
- @skipIfRocm
1669
1659
def test_multivariate_normal_shape (self ):
1670
1660
mean = torch .randn (5 , 3 , requires_grad = True )
1671
1661
mean_no_batch = torch .randn (3 , requires_grad = True )
@@ -1713,7 +1703,6 @@ def test_multivariate_normal_shape(self):
1713
1703
self ._gradcheck_log_prob (MultivariateNormal , (mean_no_batch , None , None , scale_tril_batched ))
1714
1704
1715
1705
@unittest .skipIf (not TEST_NUMPY , "Numpy not found" )
1716
- @skipIfRocm
1717
1706
def test_multivariate_normal_log_prob (self ):
1718
1707
mean = torch .randn (3 , requires_grad = True )
1719
1708
tmp = torch .randn (3 , 10 )
@@ -1751,7 +1740,6 @@ def test_multivariate_normal_log_prob(self):
1751
1740
self .assertAlmostEqual (0.0 , (batched_prob - unbatched_prob ).abs ().max (), places = 3 )
1752
1741
1753
1742
@unittest .skipIf (not TEST_NUMPY , "NumPy not found" )
1754
- @skipIfRocm
1755
1743
def test_multivariate_normal_sample (self ):
1756
1744
set_rng_seed (0 ) # see Note [Randomized statistical tests]
1757
1745
mean = torch .randn (3 , requires_grad = True )
@@ -1773,7 +1761,6 @@ def test_multivariate_normal_sample(self):
1773
1761
'MultivariateNormal(loc={}, scale_tril={})' .format (mean , scale_tril ),
1774
1762
multivariate = True )
1775
1763
1776
- @skipIfRocm
1777
1764
def test_multivariate_normal_properties (self ):
1778
1765
loc = torch .randn (5 )
1779
1766
scale_tril = transform_to (constraints .lower_cholesky )(torch .randn (5 , 5 ))
@@ -1902,7 +1889,6 @@ def ref_log_prob(idx, x, log_prob):
1902
1889
1903
1890
@unittest .skipIf (not TEST_CUDA , "CUDA not found" )
1904
1891
@unittest .skipIf (not TEST_NUMPY , "NumPy not found" )
1905
- @skipIfRocm
1906
1892
def test_gamma_gpu_shape (self ):
1907
1893
alpha = torch .tensor (torch .exp (torch .randn (2 , 3 ).cuda ()), requires_grad = True )
1908
1894
beta = torch .tensor (torch .exp (torch .randn (2 , 3 ).cuda ()), requires_grad = True )
@@ -2166,7 +2152,6 @@ def test_beta_sample(self):
2166
2152
x = Beta (Tensor ([1e-6 ]), Tensor ([1e-6 ])).sample ()[0 ]
2167
2153
self .assertTrue (np .isfinite (x ) and x > 0 , 'Invalid Beta.sample(): {}' .format (x ))
2168
2154
2169
- @skipIfRocm
2170
2155
def test_independent_shape (self ):
2171
2156
for Dist , params in EXAMPLES :
2172
2157
for i , param in enumerate (params ):
@@ -2195,7 +2180,6 @@ def test_independent_shape(self):
2195
2180
except NotImplementedError :
2196
2181
pass
2197
2182
2198
- @skipIfRocm
2199
2183
def test_cdf_icdf_inverse (self ):
2200
2184
# Tests the invertibility property on the distributions
2201
2185
for Dist , params in EXAMPLES :
@@ -2215,7 +2199,6 @@ def test_cdf_icdf_inverse(self):
2215
2199
'icdf(cdf(x)) = {}' .format (actual ),
2216
2200
]))
2217
2201
2218
- @skipIfRocm
2219
2202
def test_cdf_log_prob (self ):
2220
2203
# Tests if the differentiation of the CDF gives the PDF at a given value
2221
2204
for Dist , params in EXAMPLES :
@@ -2607,7 +2590,6 @@ def tearDown(self):
2607
2590
super (TestCase , self ).tearDown ()
2608
2591
Distribution .set_default_validate_args (False )
2609
2592
2610
- @skipIfRocm
2611
2593
def test_entropy_shape (self ):
2612
2594
for Dist , params in EXAMPLES :
2613
2595
for i , param in enumerate (params ):
@@ -3161,7 +3143,6 @@ def test_kl_monte_carlo(self):
3161
3143
3162
3144
# Multivariate normal has a separate Monte Carlo based test due to the requirement of random generation of
3163
3145
# positive (semi) definite matrices. n is set to 5, but can be increased during testing.
3164
- @skipIfRocm
3165
3146
def test_kl_multivariate_normal (self ):
3166
3147
set_rng_seed (0 ) # see Note [Randomized statistical tests]
3167
3148
n = 5 # Number of tests for multivariate_normal
@@ -3187,7 +3168,6 @@ def test_kl_multivariate_normal(self):
3187
3168
'Actual (analytic): {}' .format (actual ),
3188
3169
]))
3189
3170
3190
- @skipIfRocm
3191
3171
def test_kl_multivariate_normal_batched (self ):
3192
3172
b = 7 # Number of batches
3193
3173
loc = [torch .randn (b , 3 ) for _ in range (0 , 2 )]
@@ -3199,7 +3179,6 @@ def test_kl_multivariate_normal_batched(self):
3199
3179
MultivariateNormal (loc [1 ], scale_tril = scale_tril [1 ]))
3200
3180
self .assertEqual (expected_kl , actual_kl )
3201
3181
3202
- @skipIfRocm
3203
3182
def test_kl_multivariate_normal_batched_broadcasted (self ):
3204
3183
b = 7 # Number of batches
3205
3184
loc = [torch .randn (b , 3 ) for _ in range (0 , 2 )]
@@ -3212,7 +3191,6 @@ def test_kl_multivariate_normal_batched_broadcasted(self):
3212
3191
MultivariateNormal (loc [1 ], scale_tril = scale_tril [1 ]))
3213
3192
self .assertEqual (expected_kl , actual_kl )
3214
3193
3215
- @skipIfRocm
3216
3194
def test_kl_lowrank_multivariate_normal (self ):
3217
3195
set_rng_seed (0 ) # see Note [Randomized statistical tests]
3218
3196
n = 5 # Number of tests for lowrank_multivariate_normal
@@ -3253,7 +3231,6 @@ def test_kl_lowrank_multivariate_normal(self):
3253
3231
'Actual (analytic): {}' .format (actual_full_lowrank ),
3254
3232
]))
3255
3233
3256
- @skipIfRocm
3257
3234
def test_kl_lowrank_multivariate_normal_batched (self ):
3258
3235
b = 7 # Number of batches
3259
3236
loc = [torch .randn (b , 3 ) for _ in range (0 , 2 )]
@@ -3289,7 +3266,6 @@ def test_kl_edgecases(self):
3289
3266
self .assertEqual (kl_divergence (Bernoulli (1 ), Bernoulli (1 )), 0 )
3290
3267
self .assertEqual (kl_divergence (Categorical (torch .tensor ([0. , 1. ])), Categorical (torch .tensor ([0. , 1. ]))), 0 )
3291
3268
3292
- @skipIfRocm
3293
3269
def test_kl_shape (self ):
3294
3270
for Dist , params in EXAMPLES :
3295
3271
for i , param in enumerate (params ):
@@ -3305,7 +3281,6 @@ def test_kl_shape(self):
3305
3281
'Actual {}' .format (kl .shape ),
3306
3282
]))
3307
3283
3308
- @skipIfRocm
3309
3284
def test_entropy_monte_carlo (self ):
3310
3285
set_rng_seed (0 ) # see Note [Randomized statistical tests]
3311
3286
for Dist , params in EXAMPLES :
@@ -3349,7 +3324,6 @@ def test_entropy_exponential_family(self):
3349
3324
3350
3325
3351
3326
class TestConstraints (TestCase ):
3352
- @skipIfRocm
3353
3327
def test_params_contains (self ):
3354
3328
for Dist , params in EXAMPLES :
3355
3329
for i , param in enumerate (params ):
@@ -3373,7 +3347,6 @@ def test_params_contains(self):
3373
3347
Dist .__name__ , i + 1 , len (params ), name , value )
3374
3348
self .assertTrue (constraint .check (value ).all (), msg = message )
3375
3349
3376
- @skipIfRocm
3377
3350
def test_support_contains (self ):
3378
3351
for Dist , params in EXAMPLES :
3379
3352
self .assertIsInstance (Dist .support , Constraint )
@@ -3653,7 +3626,6 @@ def setUp(self):
3653
3626
)
3654
3627
]
3655
3628
3656
- @skipIfRocm
3657
3629
def test_mean (self ):
3658
3630
for pytorch_dist , scipy_dist in self .distribution_pairs :
3659
3631
if isinstance (pytorch_dist , (Cauchy , HalfCauchy )):
@@ -3664,7 +3636,6 @@ def test_mean(self):
3664
3636
else :
3665
3637
self .assertEqual (pytorch_dist .mean , scipy_dist .mean (), allow_inf = True , message = pytorch_dist )
3666
3638
3667
- @skipIfRocm
3668
3639
def test_variance_stddev (self ):
3669
3640
for pytorch_dist , scipy_dist in self .distribution_pairs :
3670
3641
if isinstance (pytorch_dist , (Cauchy , HalfCauchy )):
@@ -3680,7 +3651,6 @@ def test_variance_stddev(self):
3680
3651
self .assertEqual (pytorch_dist .variance , scipy_dist .var (), allow_inf = True , message = pytorch_dist )
3681
3652
self .assertEqual (pytorch_dist .stddev , scipy_dist .var () ** 0.5 , message = pytorch_dist )
3682
3653
3683
- @skipIfRocm
3684
3654
def test_cdf (self ):
3685
3655
for pytorch_dist , scipy_dist in self .distribution_pairs :
3686
3656
samples = pytorch_dist .sample ((5 ,))
@@ -3690,7 +3660,6 @@ def test_cdf(self):
3690
3660
continue
3691
3661
self .assertEqual (cdf , scipy_dist .cdf (samples ), message = pytorch_dist )
3692
3662
3693
- @skipIfRocm
3694
3663
def test_icdf (self ):
3695
3664
for pytorch_dist , scipy_dist in self .distribution_pairs :
3696
3665
samples = torch .rand ((5 ,) + pytorch_dist .batch_shape )
@@ -3996,7 +3965,6 @@ def test_biject_to(self):
3996
3965
self .assertEqual (j .shape , x .shape [:x .dim () - t .event_dim ])
3997
3966
3998
3967
@unittest .skipIf (not TEST_CUDA , "CUDA not found" )
3999
- @skipIfRocm
4000
3968
def test_biject_to_cuda (self ):
4001
3969
for constraint in self .get_constraints (is_cuda = True ):
4002
3970
try :
@@ -4047,7 +4015,6 @@ def setUp(self):
4047
4015
super (TestCase , self ).setUp ()
4048
4016
Distribution .set_default_validate_args (True )
4049
4017
4050
- @skipIfRocm
4051
4018
def test_valid (self ):
4052
4019
for Dist , params in EXAMPLES :
4053
4020
for i , param in enumerate (params ):
0 commit comments