Skip to content

Commit dc22bb3

Browse files
authored
Remove setting explicit layer precision for layers that calculate shape tensors (#642)
Signed-off-by: Kevin Chen <kevinch@nvidia.com>
1 parent ee18c9c commit dc22bb3

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

ModelImporter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,10 @@ void removeShapeTensorCasts(IImporterContext* ctx)
477477
nvinfer1::ILayer* layer = ctx->network()->getLayer(i);
478478
if (layer->getNbOutputs() > 0 && layer->getOutput(0)->isShapeTensor())
479479
{
480-
layer->resetPrecision();
481480
layer->resetOutputType(0);
482481
nvinfer1::ITensor& t = *layer->getOutput(0);
483482
// Assume that boolean tensors were not cast, and thus have their type correctly set.
484483
const nvinfer1::DataType shapeTensorType = t.getType() == nvinfer1::DataType::kBOOL ? nvinfer1::DataType::kBOOL : nvinfer1::DataType::kINT32;
485-
layer->setPrecision(shapeTensorType);
486484
layer->setOutputType(0, shapeTensorType);
487485
// Set type only if necessary, to avoid TensorRT warnings
488486
// about setting type of non-input/output tensors.

0 commit comments

Comments
 (0)