Skip to content

Commit cb1f504

Browse files
committed
more linting
1 parent 3d75482 commit cb1f504

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

core/conversion/converters/converter_util.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ nvinfer1::ITensor* addUnpadding(
5959
}
6060
}
6161

62-
nvinfer1::DataType promote_types(nvinfer1::DataType type_a, nvinfer1::DataType type_b){
62+
nvinfer1::DataType promote_types(nvinfer1::DataType type_a, nvinfer1::DataType type_b) {
6363
auto torch_type_a = util::TRTDataTypeToScalarType(type_a);
6464
auto torch_type_b = util::TRTDataTypeToScalarType(type_b);
6565
auto promo_type = at::promote_types(torch_type_a, torch_type_b);
@@ -87,15 +87,21 @@ nvinfer1::ILayer* add_elementwise(
8787
swapSelfOther = true;
8888
}
8989

90-
if(self->getType() != other->getType()){
91-
LOG_DEBUG("Type mismatch for inputs in element-wise operation " << name << ": " << self->getType() << ", " << other->getType());
90+
if (self->getType() != other->getType()) {
91+
LOG_DEBUG(
92+
"Type mismatch for inputs in element-wise operation " << name << ": " << self->getType() << ", "
93+
<< other->getType());
9294
auto promo_type = promote_types(self->getType(), other->getType());
93-
if(self->getType() != promo_type){
94-
LOG_DEBUG("Element-wise op type promotion adding cast from " << self->getType() << " to " << promo_type << " for layer " << name);
95+
if (self->getType() != promo_type) {
96+
LOG_DEBUG(
97+
"Element-wise op type promotion adding cast from " << self->getType() << " to " << promo_type << " for layer "
98+
<< name);
9599
self = castITensor(ctx, self, promo_type);
96100
}
97-
if(other->getType() != promo_type){
98-
LOG_DEBUG("Element-wise op type promotion adding cast from " << other->getType() << " to " << promo_type << " for layer " << name);
101+
if (other->getType() != promo_type) {
102+
LOG_DEBUG(
103+
"Element-wise op type promotion adding cast from " << other->getType() << " to " << promo_type
104+
<< " for layer " << name);
99105
other = castITensor(ctx, other, promo_type);
100106
}
101107
}

tests/core/conversion/converters/test_element_wise.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ void pointwise_test_helper(
2424
int first_max = 5;
2525
int second_min = 1;
2626
int second_max = 5;
27-
if(type1 == at::kBool){
27+
if (type1 == at::kBool) {
2828
first_min = 0;
2929
first_max = 1;
3030
}
31-
if(type2 == at::kBool){
31+
if (type2 == at::kBool) {
3232
second_min = 0;
3333
second_max = 1;
3434
}

0 commit comments

Comments
 (0)