@@ -41,7 +41,7 @@ def get_weight(m):
41
41
constructor_args = (10 , 8 ),
42
42
input_size = (4 , 10 ),
43
43
reference_fn = lambda i , p : torch .mm (i , p [0 ].t ()) + p [1 ].view (1 , - 1 ).expand (4 , 8 ),
44
- test_cuda = (not TEST_WITH_ROCM )
44
+ test_cuda = (not TEST_WITH_ROCM )
45
45
),
46
46
dict (
47
47
module_name = 'Linear' ,
@@ -103,28 +103,28 @@ def get_weight(m):
103
103
constructor_args = (1 ,),
104
104
input_size = (10 , 20 ),
105
105
reference_fn = lambda i , _ : torch .exp (i ).div (torch .exp (i ).sum (1 , True ).expand (10 , 20 )),
106
- test_cuda = (not TEST_WITH_ROCM )
106
+ test_cuda = (not TEST_WITH_ROCM )
107
107
),
108
108
dict (
109
109
module_name = 'Softmax2d' ,
110
110
input_size = (1 , 3 , 10 , 20 ),
111
111
reference_fn = lambda i , _ : torch .exp (i ).div (torch .exp (i ).sum (1 , False )),
112
- test_cuda = (not TEST_WITH_ROCM )
112
+ test_cuda = (not TEST_WITH_ROCM )
113
113
),
114
114
dict (
115
115
module_name = 'LogSoftmax' ,
116
116
constructor_args = (1 ,),
117
117
input_size = (10 , 20 ),
118
118
reference_fn = lambda i , _ : torch .exp (i ).div_ (torch .exp (i ).sum (1 , True ).expand (10 , 20 )).log_ (),
119
- test_cuda = (not TEST_WITH_ROCM )
119
+ test_cuda = (not TEST_WITH_ROCM )
120
120
),
121
121
dict (
122
122
module_name = 'LogSoftmax' ,
123
123
constructor_args = (1 ,),
124
124
input_size = (1 , 3 , 10 , 20 ),
125
125
reference_fn = lambda i , _ : torch .exp (i ).div_ (torch .exp (i ).sum (1 , False )).log_ (),
126
126
desc = 'multiparam' ,
127
- test_cuda = (not TEST_WITH_ROCM )
127
+ test_cuda = (not TEST_WITH_ROCM )
128
128
),
129
129
dict (
130
130
module_name = 'ELU' ,
@@ -204,61 +204,59 @@ def get_weight(m):
204
204
input_size = (2 , 3 , 4 ),
205
205
desc = '1d_multiparam' ,
206
206
reference_fn = lambda i , p : torch .clamp (i , min = 0 ) + torch .clamp (i , max = 0 ) * p [0 ][0 ],
207
- test_cuda = (not TEST_WITH_ROCM )
207
+ test_cuda = (not TEST_WITH_ROCM )
208
208
),
209
209
dict (
210
210
module_name = 'PReLU' ,
211
211
input_size = (2 , 3 , 4 , 5 ),
212
212
desc = '2d' ,
213
213
reference_fn = lambda i , p : torch .clamp (i , min = 0 ) + torch .clamp (i , max = 0 ) * p [0 ][0 ],
214
- #test_cuda = (not TEST_WITH_ROCM)
215
214
),
216
215
dict (
217
216
module_name = 'PReLU' ,
218
217
constructor_args = (3 ,),
219
218
input_size = (2 , 3 , 4 , 5 ),
220
219
desc = '2d_multiparam' ,
221
220
reference_fn = lambda i , p : torch .clamp (i , min = 0 ) + torch .clamp (i , max = 0 ) * p [0 ][0 ],
222
- test_cuda = (not TEST_WITH_ROCM )
221
+ test_cuda = (not TEST_WITH_ROCM )
223
222
),
224
223
dict (
225
224
module_name = 'PReLU' ,
226
225
input_size = (2 , 3 , 4 , 5 , 6 ),
227
226
reference_fn = lambda i , p : torch .clamp (i , min = 0 ) + torch .clamp (i , max = 0 ) * p [0 ][0 ],
228
227
desc = '3d' ,
229
- #test_cuda = (not TEST_WITH_ROCM)
230
228
),
231
229
dict (
232
230
module_name = 'PReLU' ,
233
231
constructor_args = (3 ,),
234
232
input_size = (2 , 3 , 4 , 5 , 6 ),
235
233
desc = '3d_multiparam' ,
236
234
reference_fn = lambda i , p : torch .clamp (i , min = 0 ) + torch .clamp (i , max = 0 ) * p [0 ][0 ],
237
- test_cuda = (not TEST_WITH_ROCM )
235
+ test_cuda = (not TEST_WITH_ROCM )
238
236
),
239
237
dict (
240
238
module_name = 'Softsign' ,
241
239
input_size = (3 , 2 , 5 ),
242
240
reference_fn = lambda i , _ : i .div (1 + torch .abs (i )),
243
- test_cuda = (not TEST_WITH_ROCM )
241
+ test_cuda = (not TEST_WITH_ROCM )
244
242
),
245
243
dict (
246
244
module_name = 'Softmin' ,
247
245
constructor_args = (1 ,),
248
246
input_size = (10 , 20 ),
249
- test_cuda = (not TEST_WITH_ROCM )
247
+ test_cuda = (not TEST_WITH_ROCM )
250
248
),
251
249
dict (
252
250
module_name = 'Softmin' ,
253
251
constructor_args = (1 ,),
254
252
input_size = (2 , 3 , 5 , 10 ),
255
253
desc = 'multidim' ,
256
- test_cuda = (not TEST_WITH_ROCM )
254
+ test_cuda = (not TEST_WITH_ROCM )
257
255
),
258
256
dict (
259
257
module_name = 'Tanhshrink' ,
260
258
input_size = (2 , 3 , 4 , 5 ),
261
- test_cuda = (not TEST_WITH_ROCM )
259
+ test_cuda = (not TEST_WITH_ROCM )
262
260
),
263
261
]
264
262
@@ -591,7 +589,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
591
589
reference_fn = lambda i , t , m : - (t * i .log () + (1 - t ) * (1 - i ).log ()).sum () /
592
590
(i .numel () if get_reduction (m ) else 1 ),
593
591
check_gradgrad = False ,
594
- test_cuda = (not TEST_WITH_ROCM )
592
+ test_cuda = (not TEST_WITH_ROCM )
595
593
),
596
594
dict (
597
595
module_name = 'BCELoss' ,
@@ -602,7 +600,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
602
600
(i .numel () if get_reduction (m ) else 1 ),
603
601
desc = 'weights' ,
604
602
check_gradgrad = False ,
605
- test_cuda = (not TEST_WITH_ROCM )
603
+ test_cuda = (not TEST_WITH_ROCM )
606
604
),
607
605
dict (
608
606
module_name = 'CrossEntropyLoss' ,
@@ -623,7 +621,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
623
621
reference_fn = lambda i , t , m :
624
622
hingeembeddingloss_reference (i , t , reduction = get_reduction (m )),
625
623
check_sum_reduction = True ,
626
- test_cuda = (not TEST_WITH_ROCM )
624
+ test_cuda = (not TEST_WITH_ROCM )
627
625
),
628
626
dict (
629
627
module_name = 'HingeEmbeddingLoss' ,
@@ -634,7 +632,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
634
632
hingeembeddingloss_reference (i , t , margin = 0.5 , reduction = get_reduction (m )),
635
633
desc = 'margin' ,
636
634
check_sum_reduction = True ,
637
- test_cuda = (not TEST_WITH_ROCM )
635
+ test_cuda = (not TEST_WITH_ROCM )
638
636
),
639
637
dict (
640
638
module_name = 'MultiLabelMarginLoss' ,
@@ -661,7 +659,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
661
659
target_fn = lambda : torch .rand (5 , 10 ).mul (2 ).floor (),
662
660
reference_fn = lambda i , t , m : - (t * i .sigmoid ().log () + (1 - t ) * (- i ).sigmoid ().log ()).sum () / i .numel (),
663
661
check_gradgrad = False ,
664
- test_cuda = (not TEST_WITH_ROCM )
662
+ test_cuda = (not TEST_WITH_ROCM )
665
663
),
666
664
dict (
667
665
module_name = 'MultiMarginLoss' ,
@@ -740,7 +738,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
740
738
reference_fn = lambda i , t , m :
741
739
cosineembeddingloss_reference (i [0 ], i [1 ], t , reduction = get_reduction (m )),
742
740
check_sum_reduction = True ,
743
- test_cuda = (not TEST_WITH_ROCM )
741
+ test_cuda = (not TEST_WITH_ROCM )
744
742
),
745
743
dict (
746
744
module_name = 'CosineEmbeddingLoss' ,
@@ -751,7 +749,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
751
749
cosineembeddingloss_reference (i [0 ], i [1 ], t , margin = 0.7 , reduction = get_reduction (m )),
752
750
desc = 'margin' ,
753
751
check_sum_reduction = True ,
754
- test_cuda = (not TEST_WITH_ROCM )
752
+ test_cuda = (not TEST_WITH_ROCM )
755
753
),
756
754
dict (
757
755
module_name = 'MarginRankingLoss' ,
@@ -760,7 +758,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
760
758
reference_fn = lambda i , t , m :
761
759
marginrankingloss_reference (i [0 ], i [1 ], t , reduction = get_reduction (m )),
762
760
check_sum_reduction = True ,
763
- test_cuda = (not TEST_WITH_ROCM )
761
+ test_cuda = (not TEST_WITH_ROCM )
764
762
),
765
763
dict (
766
764
module_name = 'MarginRankingLoss' ,
@@ -771,7 +769,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
771
769
marginrankingloss_reference (i [0 ], i [1 ], t , margin = 0.5 , reduction = get_reduction (m )),
772
770
desc = 'margin' ,
773
771
check_sum_reduction = True ,
774
- test_cuda = (not TEST_WITH_ROCM )
772
+ test_cuda = (not TEST_WITH_ROCM )
775
773
),
776
774
]
777
775
0 commit comments