File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
tests/core/conversion/converters Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ #include " core/compiler.h"
2+ #include " gtest/gtest.h"
3+ #include " tests/util/util.h"
4+ #include " torch/csrc/jit/ir/irparser.h"
5+
6+ TEST (Converters, ATenBitwiseNotConvertsCorrectly) {
7+ const auto graph = R"IR(
8+ graph(%0 : Tensor):
9+ %3 : Tensor = aten::bitwise_not(%0)
10+ return (%3))IR" ;
11+
12+ auto g = std::make_shared<torch::jit::Graph>();
13+ torch::jit::parseIR (graph, g.get ());
14+
15+ auto in = at::randint (-128 , 128 , {10 }, {at::kCUDA });
16+ auto params = torch_tensorrt::core::ir::get_static_params (g->inputs (), {});
17+ auto jit_results = torch_tensorrt::tests::util::RunGraph (g, params, {in});
18+
19+ in = at::clone (in);
20+ params = torch_tensorrt::core::ir::get_static_params (g->inputs , {});
21+ auto trt_results = torch_tensorrt::tests::util::RunGraphEngine (g, params, {in});
22+
23+ ASSERT_TRUE (torch_tensorrt::tests::util::exactlyEqual (jit_results[0 ], trt_results[0 ]);
24+ }
You can’t perform that action at this time.
0 commit comments