Skip to content

Commit 437670e

Browse files
committed
chore: apply linting
Signed-off-by: Bo Wang <[email protected]>
1 parent d4b7ad0 commit 437670e

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

core/compiler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ void AddSegmentedBlockToGraph(
176176
return;
177177
}
178178

179-
180179
torch::jit::script::Module CompileGraphWithFallback(const torch::jit::script::Module& mod, CompileSpec cfg) {
181180
// TODO: Should be doing a functional transform but need PR #31978
182181
// [jit] More robust mangling

core/partitioning/SegmentedBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#include <vector>
44

55
#include "NvInfer.h"
6-
#include "torch/csrc/jit/ir/ir.h"
76
#include "core/ir/ir.h"
87
#include "core/partitioning/PartitionInfo.h"
8+
#include "torch/csrc/jit/ir/ir.h"
99

1010
namespace trtorch {
1111
namespace core {

core/partitioning/shape_analysis.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ std::vector<torch::jit::IValue> generateRandomInputs(std::vector<ir::InputRange>
1919
return random_inputs;
2020
}
2121

22-
2322
void getSegmentsOutputByRunning(
2423
SegmentedBlock& seg_block,
2524
std::unordered_map<torch::jit::Value*, torch::jit::IValue>& ivalues_maps) {

tests/core/partitioning/test_fallback_graph_output.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ TEST(Partitioning, ComputeMobileNetFallbackGraphCorrectly) {
5757
cfg.partition_info.enabled = true;
5858
cfg.partition_info.forced_fallback_operators.push_back("aten::hardtanh");
5959

60-
6160
auto jit_results = mod.forward(jit_inputs_ivalues).toTensor();
6261
auto trt_mod = trtorch::core::CompileGraph(mod, cfg);
6362
auto trt_results = trt_mod.forward(trt_inputs_ivalues).toTensor();

tests/core/partitioning/test_shape_analysis.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
#include "core/partitioning/partitioning.h"
33
#include "core/util/trt_util.h"
44
#include "gtest/gtest.h"
5-
#include "torch/script.h"
65
#include "torch/csrc/jit/ir/irparser.h"
7-
6+
#include "torch/script.h"
87

98
bool checkSegmentedBlockInputShape(
109
std::vector<trtorch::core::partitioning::SegmentedBlock>& segmented_blocks,
@@ -62,8 +61,11 @@ TEST(Partitioning, InferSequentialModelSegmentedBlockShapeCorrectly) {
6261

6362
std::vector<trtorch::core::partitioning::SegmentedBlock> segmented_blocks =
6463
trtorch::core::partitioning::Partition(g, input_ranges, partition_info);
65-
ASSERT_TRUE(checkSegmentedBlockInputShape(segmented_blocks, {{{3, 3, 16, 16}, {32, 3, 3, 3}, {32}, {16, 32, 3, 3}, {16}},
66-
{{3, 16, 16, 16}}, {{3, 16, 16, 16}, {8, 16, 3, 3}, {8}}}));
64+
ASSERT_TRUE(checkSegmentedBlockInputShape(
65+
segmented_blocks,
66+
{{{3, 3, 16, 16}, {32, 3, 3, 3}, {32}, {16, 32, 3, 3}, {16}},
67+
{{3, 16, 16, 16}},
68+
{{3, 16, 16, 16}, {8, 16, 3, 3}, {8}}}));
6769
}
6870

6971
TEST(Partitioning, InferBranchModelSegmentedBlockShapeCorrectly) {
@@ -99,10 +101,11 @@ TEST(Partitioning, InferBranchModelSegmentedBlockShapeCorrectly) {
99101
input_ranges.push_back(trtorch::core::ir::InputRange({16, 32, 3, 3}));
100102
input_ranges.push_back(trtorch::core::ir::InputRange({16}));
101103

102-
103-
std::vector<trtorch::core::partitioning::SegmentedBlock> segmented_blocks =
104+
std::vector<trtorch::core::partitioning::SegmentedBlock> segmented_blocks =
104105
trtorch::core::partitioning::Partition(g, input_ranges, partition_info);
105106
ASSERT_TRUE(checkSegmentedBlockInputShape(
106-
segmented_blocks, {{{3, 3, 16, 16}, {32, 3, 3, 3}, {32}, {16, 32, 3, 3}, {16}},
107-
{{3, 32, 16, 16}}, {{3, 32, 16, 16}, {16, 32, 3, 3}, {16}, {3, 16, 16, 16}}}));
107+
segmented_blocks,
108+
{{{3, 3, 16, 16}, {32, 3, 3, 3}, {32}, {16, 32, 3, 3}, {16}},
109+
{{3, 32, 16, 16}},
110+
{{3, 32, 16, 16}, {16, 32, 3, 3}, {16}, {3, 16, 16, 16}}}));
108111
}

0 commit comments

Comments
 (0)