@@ -25,11 +25,9 @@ class pyCalibratorTrampoline : public Derived {
25
25
int getBatchSize () const noexcept override {
26
26
try {
27
27
PYBIND11_OVERLOAD_PURE_NAME (int , Derived, " get_batch_size" , getBatchSize);
28
- }
29
- catch (std::exception const &e) {
28
+ } catch (std::exception const & e) {
30
29
LOG_ERROR (" Exception caught in get_batch_size" + std::string (e.what ()));
31
- }
32
- catch (...) {
30
+ } catch (...) {
33
31
LOG_ERROR (" Exception caught in get_batch_size" );
34
32
}
35
33
return -1 ;
@@ -83,11 +81,9 @@ class pyIInt8Calibrator : public pyCalibratorTrampoline<nvinfer1::IInt8Calibrato
83
81
try {
84
82
PYBIND11_OVERLOAD_PURE_NAME (
85
83
nvinfer1::CalibrationAlgoType, nvinfer1::IInt8Calibrator, " get_algorithm" , getAlgorithm);
86
- }
87
- catch (std::exception const &e) {
84
+ } catch (std::exception const & e) {
88
85
LOG_ERROR (" Exception caught in get_algorithm: " + std::string (e.what ()));
89
- }
90
- catch (...) {
86
+ } catch (...) {
91
87
LOG_ERROR (" Exception caught in get_algorithm" );
92
88
}
93
89
return {};
@@ -102,24 +98,21 @@ class pyIInt8LegacyCalibrator : public pyCalibratorTrampoline<nvinfer1::IInt8Leg
102
98
double getQuantile () const noexcept override {
103
99
try {
104
100
PYBIND11_OVERLOAD_PURE_NAME (double , nvinfer1::IInt8LegacyCalibrator, " get_quantile" , getQuantile);
105
- }
106
- catch (std::exception const &e) {
101
+ } catch (std::exception const & e) {
107
102
LOG_ERROR (" Exception caught in get_quantile: " + std::string (e.what ()));
108
- }
109
- catch (...) {
103
+ } catch (...) {
110
104
LOG_ERROR (" Exception caught in get_quantile" );
111
105
}
112
106
return -1.0 ;
113
107
}
114
108
115
109
double getRegressionCutoff () const noexcept override {
116
110
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) {
120
114
LOG_ERROR (" Exception caught in get_regression_cutoff: " + std::string (e.what ()));
121
- }
122
- catch (...) {
115
+ } catch (...) {
123
116
LOG_ERROR (" Exception caught in get_regression_cutoff" );
124
117
}
125
118
return -1.0 ;
@@ -129,11 +122,9 @@ class pyIInt8LegacyCalibrator : public pyCalibratorTrampoline<nvinfer1::IInt8Leg
129
122
try {
130
123
PYBIND11_OVERLOAD_PURE_NAME (
131
124
const char *, nvinfer1::IInt8LegacyCalibrator, " read_histogram_cache" , readHistogramCache, length);
132
- }
133
- catch (std::exception const & e) {
125
+ } catch (std::exception const & e) {
134
126
LOG_ERROR (" Exception caught in read_histogram_cache" + std::string (e.what ()));
135
- }
136
- catch (...) {
127
+ } catch (...) {
137
128
LOG_ERROR (" Exception caught in read_histogram_cache" );
138
129
}
139
130
return {};
@@ -143,11 +134,9 @@ class pyIInt8LegacyCalibrator : public pyCalibratorTrampoline<nvinfer1::IInt8Leg
143
134
try {
144
135
PYBIND11_OVERLOAD_PURE_NAME (
145
136
void , nvinfer1::IInt8LegacyCalibrator, " write_histogram_cache" , writeHistogramCache, ptr, length);
146
- }
147
- catch (std::exception const & e) {
137
+ } catch (std::exception const & e) {
148
138
LOG_ERROR (" Exception caught in write_histogram_cache" + std::string (e.what ()));
149
- }
150
- catch (...) {
139
+ } catch (...) {
151
140
LOG_ERROR (" Exception caught in write_histogram_cache" );
152
141
}
153
142
}
0 commit comments