Skip to content

Commit 0705a54

Browse files
committed
chore: pre-commit lint
Signed-off-by: Anurag Dixit <[email protected]>
1 parent 1f30051 commit 0705a54

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

py/torch_tensorrt/csrc/torch_tensorrt_py.cpp

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ class pyCalibratorTrampoline : public Derived {
2525
int getBatchSize() const noexcept override {
2626
try {
2727
PYBIND11_OVERLOAD_PURE_NAME(int, Derived, "get_batch_size", getBatchSize);
28-
}
29-
catch(std::exception const &e) {
28+
} catch (std::exception const& e) {
3029
LOG_ERROR("Exception caught in get_batch_size" + std::string(e.what()));
31-
}
32-
catch(...) {
30+
} catch (...) {
3331
LOG_ERROR("Exception caught in get_batch_size");
3432
}
3533
return -1;
@@ -83,11 +81,9 @@ class pyIInt8Calibrator : public pyCalibratorTrampoline<nvinfer1::IInt8Calibrato
8381
try {
8482
PYBIND11_OVERLOAD_PURE_NAME(
8583
nvinfer1::CalibrationAlgoType, nvinfer1::IInt8Calibrator, "get_algorithm", getAlgorithm);
86-
}
87-
catch(std::exception const &e) {
84+
} catch (std::exception const& e) {
8885
LOG_ERROR("Exception caught in get_algorithm: " + std::string(e.what()));
89-
}
90-
catch(...) {
86+
} catch (...) {
9187
LOG_ERROR("Exception caught in get_algorithm");
9288
}
9389
return {};
@@ -102,24 +98,21 @@ class pyIInt8LegacyCalibrator : public pyCalibratorTrampoline<nvinfer1::IInt8Leg
10298
double getQuantile() const noexcept override {
10399
try {
104100
PYBIND11_OVERLOAD_PURE_NAME(double, nvinfer1::IInt8LegacyCalibrator, "get_quantile", getQuantile);
105-
}
106-
catch(std::exception const &e) {
101+
} catch (std::exception const& e) {
107102
LOG_ERROR("Exception caught in get_quantile: " + std::string(e.what()));
108-
}
109-
catch(...) {
103+
} catch (...) {
110104
LOG_ERROR("Exception caught in get_quantile");
111105
}
112106
return -1.0;
113107
}
114108

115109
double getRegressionCutoff() const noexcept override {
116110
try {
117-
PYBIND11_OVERLOAD_PURE_NAME(double, nvinfer1::IInt8LegacyCalibrator, "get_regression_cutoff", getRegressionCutoff);
118-
}
119-
catch(std::exception const &e) {
111+
PYBIND11_OVERLOAD_PURE_NAME(
112+
double, nvinfer1::IInt8LegacyCalibrator, "get_regression_cutoff", getRegressionCutoff);
113+
} catch (std::exception const& e) {
120114
LOG_ERROR("Exception caught in get_regression_cutoff: " + std::string(e.what()));
121-
}
122-
catch(...) {
115+
} catch (...) {
123116
LOG_ERROR("Exception caught in get_regression_cutoff");
124117
}
125118
return -1.0;
@@ -129,11 +122,9 @@ class pyIInt8LegacyCalibrator : public pyCalibratorTrampoline<nvinfer1::IInt8Leg
129122
try {
130123
PYBIND11_OVERLOAD_PURE_NAME(
131124
const char*, nvinfer1::IInt8LegacyCalibrator, "read_histogram_cache", readHistogramCache, length);
132-
}
133-
catch(std::exception const& e) {
125+
} catch (std::exception const& e) {
134126
LOG_ERROR("Exception caught in read_histogram_cache" + std::string(e.what()));
135-
}
136-
catch(...) {
127+
} catch (...) {
137128
LOG_ERROR("Exception caught in read_histogram_cache");
138129
}
139130
return {};
@@ -143,11 +134,9 @@ class pyIInt8LegacyCalibrator : public pyCalibratorTrampoline<nvinfer1::IInt8Leg
143134
try {
144135
PYBIND11_OVERLOAD_PURE_NAME(
145136
void, nvinfer1::IInt8LegacyCalibrator, "write_histogram_cache", writeHistogramCache, ptr, length);
146-
}
147-
catch(std::exception const& e) {
137+
} catch (std::exception const& e) {
148138
LOG_ERROR("Exception caught in write_histogram_cache" + std::string(e.what()));
149-
}
150-
catch(...) {
139+
} catch (...) {
151140
LOG_ERROR("Exception caught in write_histogram_cache");
152141
}
153142
}

0 commit comments

Comments
 (0)