Skip to content

Commit 7059eba

Browse files
committed
refactor: Apply linting
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent f90cb21 commit 7059eba

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

core/conversion/evaluators/aten.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,9 @@ auto aten_registrations TORCHTRT_UNUSED =
353353
return {};
354354
}
355355
},
356-
EvalOptions().validSchemas({
357-
"aten::add.int(int a, int b) -> (int)",
358-
"aten::add.float(float a, float b) -> (float)",
359-
"aten::add.str(str a, str b) -> (str)"
360-
})})
356+
EvalOptions().validSchemas({"aten::add.int(int a, int b) -> (int)",
357+
"aten::add.float(float a, float b) -> (float)",
358+
"aten::add.str(str a, str b) -> (str)"})})
361359
.evaluator({c10::Symbol::fromQualString("aten::add_"),
362360
[](const torch::jit::Node* n, kwargs& args) -> c10::optional<torch::jit::IValue> {
363361
if (args.at(n->input(0)).IValue()->isList()) {

core/lowering/passes/exception_elimination.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ struct ExceptionOrPassPatternElimination {
4444
bool arm1_starts_with_exception = (*arm1_start)->kind() == prim::RaiseException;
4545
bool arm2_starts_with_exception = (*arm2_start)->kind() == prim::RaiseException;
4646

47-
//if (!arm1_starts_with_exception && !arm2_starts_with_exception) {
48-
// Neither arm matches the pattern
49-
// return false;
47+
// if (!arm1_starts_with_exception && !arm2_starts_with_exception) {
48+
// Neither arm matches the pattern
49+
// return false;
5050
//}
5151

5252
/// Check if this Node hosts a pattern like so:
@@ -90,7 +90,7 @@ struct ExceptionOrPassPatternElimination {
9090
for (auto it = b->nodes().begin(); it != b->nodes().end(); it++) {
9191
auto n = *it;
9292
if (n->kind() == prim::If && isExceptionOrPassNode(n)) {
93-
LOG_ERROR("Found that node " << *n << " is an exception or pass node (EliminateChecks)" << std::endl);
93+
LOG_GRAPH("Found that node " << *n << " is an exception or pass node (EliminateChecks)" << std::endl);
9494
it.destroyCurrent();
9595
}
9696
}
@@ -104,7 +104,7 @@ void EliminateExceptionOrPassPattern(std::shared_ptr<Graph> graph) {
104104
ExceptionOrPassPatternElimination eppe(std::move(graph));
105105
eppe.run();
106106
if (graph) {
107-
LOG_ERROR("Post Eliminate Exception or Pass Patterns: " << *graph);
107+
LOG_GRAPH("Post Eliminate Exception or Pass Patterns: " << *graph);
108108
}
109109
}
110110

core/lowering/register_trt_placeholder_ops.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ c10::AliasAnalysisKind aliasAnalysisFromSchema() {
1010
RegisterOperators trt_placeholder_ops_reg({
1111
/// Op marks a Tensor to be conveted from an Torch Tensor
1212
/// to a TRT constant Tensor
13-
Operator("trt::const(Tensor val) -> Tensor", [](Stack& stack) { /*noop*/ }, aliasAnalysisFromSchema()),
13+
Operator(
14+
"trt::const(Tensor val) -> Tensor",
15+
[](Stack& stack) { /*noop*/ },
16+
aliasAnalysisFromSchema()),
1417
});
1518

1619
} // namespace jit

core/partitioning/partitioning.cpp

100755100644
File mode changed.

tests/core/lowering/test_exception_elimination_pass.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ TEST(LoweringPasses, EliminateExceptionOrPassPattern_Block0) {
4444
auto if_block0 = if_node->addBlock();
4545
auto exception_node = g->create(torch::jit::prim::RaiseException, {except_val, none_const_val}, 0);
4646
if_block0->appendNode(exception_node);
47-
/*auto if_block1 =*/ if_node->addBlock();
47+
/*auto if_block1 =*/if_node->addBlock();
4848
g->insertNode(if_node);
4949
auto cat_node = g->create(torch::jit::aten::cat, {list_node->output(), zero_const_val});
5050
g->insertNode(cat_node);
@@ -97,7 +97,7 @@ TEST(LoweringPasses, EliminateExceptionOrPassPattern_Block1) {
9797
bool_node->output()->setType(torch::jit::BoolType::get());
9898
g->insertNode(bool_node);
9999
auto if_node = g->create(torch::jit::prim::If, {bool_node->output()}, 0);
100-
/*auto if_block0 = */if_node->addBlock();
100+
/*auto if_block0 = */ if_node->addBlock();
101101
auto if_block1 = if_node->addBlock();
102102
auto exception_node = g->create(torch::jit::prim::RaiseException, {except_val, none_const_val}, 0);
103103
if_block1->appendNode(exception_node);
@@ -154,7 +154,7 @@ TEST(LoweringPasses, EliminateExceptionOrPassPattern_Negative) {
154154
auto if_block0 = if_node->addBlock();
155155
auto append_node = g->create(torch::jit::aten::append, {list_node->output(), y});
156156
if_block0->appendNode(append_node);
157-
/*auto if_block1 = */if_node->addBlock();
157+
/*auto if_block1 = */ if_node->addBlock();
158158
g->insertNode(if_node);
159159
auto cat_node = g->create(torch::jit::aten::cat, {list_node->output(), zero_const_val});
160160
g->insertNode(cat_node);

0 commit comments

Comments
 (0)