@@ -243,7 +243,7 @@ nvinfer1::ITensor* clamp_to_input_dim(ConversionCtx* ctx, nvinfer1::ITensor* x,
243
243
}
244
244
245
245
// return indices < 0 ? inputDims + indices : indices
246
- nvinfer1::ITensor* bump_if_negtive (ConversionCtx* ctx, nvinfer1::ITensor* input_dim, nvinfer1::ITensor* indices, int nbdims) {
246
+ nvinfer1::ITensor* bump_if_negative (ConversionCtx* ctx, nvinfer1::ITensor* input_dim, nvinfer1::ITensor* indices, int nbdims) {
247
247
auto zero = torch::zeros ({nbdims}).to (torch::kI32 );
248
248
auto neg = -torch::ones ({nbdims}).to (torch::kI32 );
249
249
auto zero_itensor = tensor_to_const (ctx, zero);
@@ -253,14 +253,14 @@ nvinfer1::ITensor* bump_if_negtive(ConversionCtx* ctx, nvinfer1::ITensor* input_
253
253
254
254
// get the inputDim value where indices == -1, else 0
255
255
auto mul = ctx->net ->addElementWise (*signs, *input_dim, nvinfer1::ElementWiseOperation::kPROD );
256
- TORCHTRT_CHECK (mul, " Unable to create mul layer in bump_if_negtive " );
257
- LOG_DEBUG (ctx->logger , " Create " << mul->getName () << " for bump_if_negtive " );
256
+ TORCHTRT_CHECK (mul, " Unable to create mul layer in bump_if_negative " );
257
+ LOG_DEBUG (ctx->logger , " Create " << mul->getName () << " for bump_if_negative " );
258
258
auto mul_itensor = mul->getOutput (0 );
259
259
260
260
// add the inputDim value to indices where indices == -1
261
261
auto sub = ctx->net ->addElementWise (*indices, *mul_itensor, nvinfer1::ElementWiseOperation::kSUB );
262
- TORCHTRT_CHECK (sub, " Unable to create sub layer in bump_if_negtive " );
263
- LOG_DEBUG (ctx->logger , " Create " << sub->getName () << " for bump_if_negtive " );
262
+ TORCHTRT_CHECK (sub, " Unable to create sub layer in bump_if_negative " );
263
+ LOG_DEBUG (ctx->logger , " Create " << sub->getName () << " for bump_if_negative " );
264
264
auto sub_itensor = sub->getOutput (0 );
265
265
return sub_itensor;
266
266
}
@@ -271,9 +271,9 @@ std::vector<nvinfer1::ITensor*> update_start_and_end(
271
271
nvinfer1::ITensor* in_start,
272
272
nvinfer1::ITensor* in_end,
273
273
int nbdims) {
274
- auto start = bump_if_negtive (ctx, in_shape, in_start, nbdims);
274
+ auto start = bump_if_negative (ctx, in_shape, in_start, nbdims);
275
275
auto out_start = clamp_to_input_dim (ctx, start, in_shape, nbdims);
276
- auto end = bump_if_negtive (ctx, in_shape, in_end, nbdims);
276
+ auto end = bump_if_negative (ctx, in_shape, in_end, nbdims);
277
277
auto out_end = clamp_to_input_dim (ctx, end, in_shape, nbdims);
278
278
std::vector<nvinfer1::ITensor*> outputs;
279
279
outputs.push_back (out_start);
@@ -309,17 +309,6 @@ nvinfer1::ITensor* calculate_output_size(
309
309
return size_itensor;
310
310
}
311
311
312
- bool is_dynamic_shape (nvinfer1::ITensor* tensor) {
313
- auto dim = tensor->getDimensions ();
314
- auto ndims = dim.nbDims ;
315
- for (int i = 0 ; i < ndims; i++) {
316
- if (dim.d [i] == -1 ) {
317
- return true ;
318
- }
319
- }
320
- return false ;
321
- }
322
-
323
312
} // namespace converters
324
313
} // namespace conversion
325
314
} // namespace core
0 commit comments