@@ -177,17 +177,17 @@ namespace dnn {
177
177
178
178
nvinfer1::IOptimizationProfile* profile = builder->createOptimizationProfile ();
179
179
profile->setDimensions (
180
- network->getInput (0 )->getName (), nvinfer1::OptProfileSelector::kMIN , nvinfer1::Dims4 (1 , 3 , size.height , size.width ));
180
+ network->getInput (0 )->getName (), nvinfer1::OptProfileSelector::kMIN , nvinfer1::Dims4 (1 , 3 , size.height , size.width ));
181
181
profile->setDimensions (
182
- network->getInput (0 )->getName (), nvinfer1::OptProfileSelector::kOPT , nvinfer1::Dims4 (max_batch_size, 3 , size.height , size.width ));
182
+ network->getInput (0 )->getName (), nvinfer1::OptProfileSelector::kOPT , nvinfer1::Dims4 (max_batch_size, 3 , size.height , size.width ));
183
183
profile->setDimensions (
184
- network->getInput (0 )->getName (), nvinfer1::OptProfileSelector::kMAX , nvinfer1::Dims4 (max_batch_size, 3 , size.height , size.width ));
185
- // profile->setDimensions(
186
- // network->getInput(0)->getName(), nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims4(1, size.height, size.width, 3));
187
- // profile->setDimensions(
188
- // network->getInput(0)->getName(), nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims4(1, size.height, size.width, 3));
189
- // profile->setDimensions(
190
- // network->getInput(0)->getName(), nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims4(max_batch_size, size.height, size.width, 3));
184
+ network->getInput (0 )->getName (), nvinfer1::OptProfileSelector::kMAX , nvinfer1::Dims4 (max_batch_size, 3 , size.height , size.width ));
185
+ // profile->setDimensions(
186
+ // network->getInput(0)->getName(), nvinfer1::OptProfileSelector::kMIN, nvinfer1::Dims4(1, size.height, size.width, 3));
187
+ // profile->setDimensions(
188
+ // network->getInput(0)->getName(), nvinfer1::OptProfileSelector::kOPT, nvinfer1::Dims4(1, size.height, size.width, 3));
189
+ // profile->setDimensions(
190
+ // network->getInput(0)->getName(), nvinfer1::OptProfileSelector::kMAX, nvinfer1::Dims4(max_batch_size, size.height, size.width, 3));
191
191
config->addOptimizationProfile (profile);
192
192
193
193
auto engine = builder->buildEngineWithConfig (*network, *config);
@@ -229,7 +229,7 @@ namespace dnn {
229
229
const std::string name (m_engine->getBindingName (i));
230
230
231
231
if (m_engine->bindingIsInput (i))
232
- size_vector = {3 , m_inp_size.height , m_inp_size.width };
232
+ size_vector = { 3 , m_inp_size.height , m_inp_size.width };
233
233
else {
234
234
const int offset = dims.nbDims - 3 ;
235
235
for (int j = 0 ; j < 3 ; ++j)
@@ -266,7 +266,7 @@ namespace dnn {
266
266
const std::string name (m_engine->getBindingName (i));
267
267
268
268
if (m_engine->bindingIsInput (i))
269
- size_vector = {3 , m_inp_size.height , m_inp_size.width };
269
+ size_vector = { 3 , m_inp_size.height , m_inp_size.width };
270
270
else {
271
271
const int offset = dims.nbDims - 3 ;
272
272
for (int j = 0 ; j < 3 ; ++j)
@@ -310,8 +310,8 @@ namespace dnn {
310
310
auto context = m_engine->createExecutionContext ();
311
311
std::vector<void *> buffer_ptrs_ (m_cuda_buffers.size ());
312
312
std::transform (
313
- m_cuda_buffers.begin (), m_cuda_buffers.end (),
314
- buffer_ptrs_.begin (), [](const auto & b) { return b.data (); });
313
+ m_cuda_buffers.begin (), m_cuda_buffers.end (),
314
+ buffer_ptrs_.begin (), [](const auto & b) { return b.data (); });
315
315
context->execute (batch_size, buffer_ptrs_.data ());
316
316
context->destroy ();
317
317
}
0 commit comments