Skip to content

Commit

Permalink
[IE TESTS] removing bathSize
Browse files Browse the repository at this point in the history
  • Loading branch information
antonzaycev96 committed Jul 3, 2020
1 parent 0b5e003 commit f6ed690
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ void LayerTestsCommon::Compare(const std::vector<std::uint8_t> &expected, const

const auto &precision = actual->getTensorDesc().getPrecision();
auto resize = 1;
auto bathSize = 1;
// With dynamic batch, you need to size
if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED)) {
resize = actual->getTensorDesc().getDims()[0];
bathSize = resize > 1 ? resize/ 2 : 1;
}
const auto &size = (actual->size() * bathSize / resize);
switch (precision) {
Expand Down Expand Up @@ -102,7 +104,7 @@ void LayerTestsCommon::Infer() {
inputs.push_back(blob);
}
if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED)) {
bathSize = cnnNetwork.getInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2;
auto bathSize = cnnNetwork.getInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2;
inferRequest.SetBatch(bathSize);
}
inferRequest.Infer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class LayerTestsCommon : public CommonTestUtils::TestsCommon {
std::vector<InferenceEngine::Blob::Ptr> inputs;
float threshold;
InferenceEngine::CNNNetwork cnnNetwork;
int bathSize = 1; // dynamic bath size ( first dimension in inputShapes > 1 !!!)
virtual void Validate();

virtual std::vector<std::vector<std::uint8_t>> CalculateRefs();
Expand Down

0 comments on commit f6ed690

Please sign in to comment.