@@ -243,7 +243,7 @@ nvinfer1::ITensor* clamp_to_input_dim(ConversionCtx* ctx, nvinfer1::ITensor* x,
243243}
244244
245245// 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) {
247247 auto zero = torch::zeros ({nbdims}).to (torch::kI32 );
248248 auto neg = -torch::ones ({nbdims}).to (torch::kI32 );
249249 auto zero_itensor = tensor_to_const (ctx, zero);
@@ -253,14 +253,14 @@ nvinfer1::ITensor* bump_if_negtive(ConversionCtx* ctx, nvinfer1::ITensor* input_
253253
254254 // get the inputDim value where indices == -1, else 0
255255 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 " );
258258 auto mul_itensor = mul->getOutput (0 );
259259
260260 // add the inputDim value to indices where indices == -1
261261 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 " );
264264 auto sub_itensor = sub->getOutput (0 );
265265 return sub_itensor;
266266}
@@ -271,9 +271,9 @@ std::vector<nvinfer1::ITensor*> update_start_and_end(
271271 nvinfer1::ITensor* in_start,
272272 nvinfer1::ITensor* in_end,
273273 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);
275275 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);
277277 auto out_end = clamp_to_input_dim (ctx, end, in_shape, nbdims);
278278 std::vector<nvinfer1::ITensor*> outputs;
279279 outputs.push_back (out_start);
@@ -309,17 +309,6 @@ nvinfer1::ITensor* calculate_output_size(
309309 return size_itensor;
310310}
311311
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-
323312} // namespace converters
324313} // namespace conversion
325314} // namespace core
0 commit comments