Skip to content

Commit

Permalink
fix: aten::gelu call was wrong in test
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
  • Loading branch information
narendasan committed Nov 3, 2021
1 parent cc7d0b7 commit 40bc4e3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/core/conversion/converters/test_activation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,10 @@ TEST(Converters, ATenEluConvertsCorrectly) {
ASSERT_TRUE(torch_tensorrt::tests::util::almostEqual(jit_results[0], trt_results[0], 2e-6));
}

#ifndef DISABLE_TEST_IN_CI

TEST(Converters, ATenGELUConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
%1 : bool = prim::Constant[value=0]()
%3 : Tensor = aten::gelu(%0, %1)
%3 : Tensor = aten::gelu(%0)
return (%3))IR";

auto g = std::make_shared<torch::jit::Graph>();
Expand All @@ -226,6 +223,5 @@ TEST(Converters, ATenGELUConvertsCorrectly) {
// c10::cuda::compat::normcdf to compute Phi(x). So there's a difference here and therefore the threshold is slightly
// higher than other ops. One in ten runs will give you an out of normal threshold result

ASSERT_TRUE(torch_tensorrt::tests::util::almostEqual(jit_results[0], trt_results[0], 5e-3));
ASSERT_TRUE(torch_tensorrt::tests::util::almostEqual(jit_results[0], trt_results[0], 5e-2));
}
#endif

0 comments on commit 40bc4e3

Please sign in to comment.