File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -499,6 +499,8 @@ TEST_F(RNNTest, BidirectionalGRUReverseForward_CUDA) {
499
499
// Reverse forward of bidirectional LSTM should act
500
500
// as regular forward of unidirectional LSTM
501
501
void BidirectionalLSTMReverseForwardTest (bool cuda) {
502
+ // ROCm 6.3 had a regression in RNN behavior requiring ASSERT_NEAR
503
+ constexpr auto tolerance = 1e-5 ;
502
504
auto opt = torch::TensorOptions ()
503
505
.dtype (torch::kFloat32 )
504
506
.requires_grad (false )
@@ -532,9 +534,10 @@ void BidirectionalLSTMReverseForwardTest(bool cuda) {
532
534
std::get<0 >(bi_output).size (0 ), std::get<0 >(reverse_output).size (0 ));
533
535
auto size = std::get<0 >(bi_output).size (0 );
534
536
for (int i = 0 ; i < size; i++) {
535
- ASSERT_EQ (
537
+ ASSERT_NEAR (
536
538
std::get<0 >(bi_output)[i][0 ][1 ].item <float >(),
537
- std::get<0 >(reverse_output)[size - 1 - i][0 ][0 ].item <float >());
539
+ std::get<0 >(reverse_output)[size - 1 - i][0 ][0 ].item <float >(),
540
+ tolerance);
538
541
}
539
542
// The hidden states of the reversed LSTM sits
540
543
// in the odd indices in the first dimension.
You can’t perform that action at this time.
0 commit comments