Commit 62d079fa authored by Dmitry Kurtaev's avatar Dmitry Kurtaev

Fix Normalize layer for Mac

parent c9a76ede
...@@ -275,13 +275,13 @@ public: ...@@ -275,13 +275,13 @@ public:
InferenceEngine::Blob::Ptr weights; InferenceEngine::Blob::Ptr weights;
if (blobs.empty()) if (blobs.empty())
{ {
auto onesBlob = InferenceEngine::make_shared_blob<float>(InferenceEngine::Precision::FP32, weights = InferenceEngine::make_shared_blob<float>(InferenceEngine::Precision::FP32,
InferenceEngine::Layout::C, InferenceEngine::Layout::C,
{(size_t)numChannels}); {(size_t)numChannels});
onesBlob->allocate(); weights->allocate();
std::vector<float> ones(numChannels, 1);
onesBlob->set(ones); Mat weightsMat = infEngineBlobToMat(weights).reshape(1, numChannels);
weights = onesBlob; Mat(numChannels, 1, CV_32F, Scalar(1)).copyTo(weightsMat);
l.getParameters()["channel_shared"] = false; l.getParameters()["channel_shared"] = false;
} }
else else
...@@ -290,11 +290,7 @@ public: ...@@ -290,11 +290,7 @@ public:
weights = wrapToInfEngineBlob(blobs[0], {(size_t)numChannels}, InferenceEngine::Layout::C); weights = wrapToInfEngineBlob(blobs[0], {(size_t)numChannels}, InferenceEngine::Layout::C);
l.getParameters()["channel_shared"] = blobs[0].total() == 1; l.getParameters()["channel_shared"] = blobs[0].total() == 1;
} }
#if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2019R1) addConstantData("weights", weights, l);
l.getParameters()["weights"] = weights;
#else
l.addConstantData("weights", weights);
#endif
l.getParameters()["across_spatial"] = acrossSpatial; l.getParameters()["across_spatial"] = acrossSpatial;
return Ptr<BackendNode>(new InfEngineBackendNode(l)); return Ptr<BackendNode>(new InfEngineBackendNode(l));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment