@@ -207,13 +207,13 @@ nvinfer1::ITensor* clamp(
207
207
nvinfer1::ITensor* lower_bound,
208
208
nvinfer1::ITensor* upper_bound,
209
209
std::string const & name) {
210
-
211
210
auto max_layer = add_elementwise (ctx, nvinfer1::ElementWiseOperation::kMAX , x, lower_bound, " max layer for " + name);
212
211
TORCHTRT_CHECK (max_layer, " Unable to create max layer for clamp" );
213
212
LOG_DEBUG (ctx->logger , " Create " << max_layer->getName () << " for clamp" );
214
213
auto max_itensor = max_layer->getOutput (0 );
215
214
216
- auto min_layer = add_elementwise (ctx, nvinfer1::ElementWiseOperation::kMIN , max_itensor, upper_bound, " min layer for " + name);
215
+ auto min_layer =
216
+ add_elementwise (ctx, nvinfer1::ElementWiseOperation::kMIN , max_itensor, upper_bound, " min layer for " + name);
217
217
TORCHTRT_CHECK (min_layer, " Unable to create min layer for clamp" );
218
218
LOG_DEBUG (ctx->logger , " Create " << min_layer->getName () << " for clamp" );
219
219
auto min_itensor = min_layer->getOutput (0 );
@@ -227,13 +227,13 @@ nvinfer1::ITensor* clamp_to_input_dim(
227
227
nvinfer1::ITensor* input_dim,
228
228
int nbdims,
229
229
std::string const & name) {
230
-
231
230
auto zero = torch::zeros ({nbdims}).to (torch::kI32 );
232
231
auto zero_itensor = tensor_to_const (ctx, zero);
233
232
auto one = torch::ones ({nbdims}).to (torch::kI32 );
234
233
auto one_itensor = tensor_to_const (ctx, one);
235
234
236
- auto upper_bound_layer = add_elementwise (ctx, nvinfer1::ElementWiseOperation::kSUB , input_dim, one_itensor, " sub layer for " + name);
235
+ auto upper_bound_layer =
236
+ add_elementwise (ctx, nvinfer1::ElementWiseOperation::kSUB , input_dim, one_itensor, " sub layer for " + name);
237
237
TORCHTRT_CHECK (upper_bound_layer, " Unable to create sub layer for clamp to inputDim" );
238
238
LOG_DEBUG (ctx->logger , " Create " << upper_bound_layer->getName () << " for clamp to inputDim" );
239
239
auto upper_bound = upper_bound_layer->getOutput (0 );
@@ -243,7 +243,8 @@ nvinfer1::ITensor* clamp_to_input_dim(
243
243
LOG_DEBUG (ctx->logger , " Create " << max_layer->getName () << " for clamp to inputDim" );
244
244
auto max_itensor = max_layer->getOutput (0 );
245
245
246
- auto min_layer = add_elementwise (ctx, nvinfer1::ElementWiseOperation::kMIN , max_itensor, upper_bound, " min layer for " + name);
246
+ auto min_layer =
247
+ add_elementwise (ctx, nvinfer1::ElementWiseOperation::kMIN , max_itensor, upper_bound, " min layer for " + name);
247
248
TORCHTRT_CHECK (min_layer, " Unable to create min_layer for clamp to inputDim" );
248
249
LOG_DEBUG (ctx->logger , " Create " << min_layer->getName () << " for clamp to inputDim" );
249
250
auto min_itensor = min_layer->getOutput (0 );
@@ -257,7 +258,6 @@ nvinfer1::ITensor* normalize_indices(
257
258
nvinfer1::ITensor* indices,
258
259
int nbdims,
259
260
std::string const & name) {
260
-
261
261
auto zero = torch::zeros ({nbdims}).to (torch::kI32 );
262
262
auto neg = -torch::ones ({nbdims}).to (torch::kI32 );
263
263
auto zero_itensor = tensor_to_const (ctx, zero);
@@ -307,17 +307,20 @@ nvinfer1::ITensor* get_slice_size(
307
307
at::Tensor one_tensor = torch::ones ({nbdims}).to (torch::kI32 );
308
308
auto one_itensor = tensor_to_const (ctx, one_tensor);
309
309
310
- auto sub_layer = add_elementwise (ctx, nvinfer1::ElementWiseOperation::kSUB , end, start, " get_slice_size sub layer for " + name);
310
+ auto sub_layer =
311
+ add_elementwise (ctx, nvinfer1::ElementWiseOperation::kSUB , end, start, " get_slice_size sub layer for " + name);
311
312
TORCHTRT_CHECK (sub_layer, " Unable to create sub layer in calculate_output_size" );
312
313
LOG_DEBUG (ctx->logger , " Create " << sub_layer->getName () << " for calculate_output_size" );
313
314
auto sub_itensor = sub_layer->getOutput (0 );
314
315
315
- auto div_layer = add_elementwise (ctx, nvinfer1::ElementWiseOperation::kDIV , sub_itensor, stride, " get_slice_size div layer for " + name);
316
+ auto div_layer = add_elementwise (
317
+ ctx, nvinfer1::ElementWiseOperation::kDIV , sub_itensor, stride, " get_slice_size div layer for " + name);
316
318
TORCHTRT_CHECK (div_layer, " Unable to create div layer in calculate_output_size" );
317
319
LOG_DEBUG (ctx->logger , " Create " << div_layer->getName () << " for calculate_output_size" );
318
320
auto div_itensor = div_layer->getOutput (0 );
319
321
320
- auto add_layer = add_elementwise (ctx, nvinfer1::ElementWiseOperation::kSUM , div_itensor, one_itensor, " get_slice_size sum layer for " + name);
322
+ auto add_layer = add_elementwise (
323
+ ctx, nvinfer1::ElementWiseOperation::kSUM , div_itensor, one_itensor, " get_slice_size sum layer for " + name);
321
324
TORCHTRT_CHECK (add_layer, " Unable to create add layer in calculate_output_size" );
322
325
LOG_DEBUG (ctx->logger , " Create " << add_layer->getName () << " for calculate_output_size" );
323
326
auto size_itensor = add_layer->getOutput (0 );
0 commit comments