Fix error check: zero actual profiles are only error if wanted to create at least one

This commit is contained in:
Tamas Bela Feher 2020-02-21 20:04:41 +01:00
parent 81e1f58af4
commit 4c01652457

View File

@ -76,7 +76,7 @@ Status TrtShapeOptimizationProfile::AddProfiles(
<< ". This usually happens when profile is invalid.";
}
}
if (config->getNbOptimizationProfiles() == 0) {
if (!profiles_.empty() && config->getNbOptimizationProfiles() == 0) {
return errors::Internal("Failure in adding an optimization profile.");
}
// if TRT_VERSION < 6, then we do not need to add