@@ -59,7 +59,7 @@ nvinfer1::ITensor* addUnpadding(
59
59
}
60
60
}
61
61
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) {
63
63
auto torch_type_a = util::TRTDataTypeToScalarType (type_a);
64
64
auto torch_type_b = util::TRTDataTypeToScalarType (type_b);
65
65
auto promo_type = at::promote_types (torch_type_a, torch_type_b);
@@ -87,15 +87,21 @@ nvinfer1::ILayer* add_elementwise(
87
87
swapSelfOther = true ;
88
88
}
89
89
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 ());
92
94
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);
95
99
self = castITensor (ctx, self, promo_type);
96
100
}
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);
99
105
other = castITensor (ctx, other, promo_type);
100
106
}
101
107
}
0 commit comments