Commit 0687cffe authored by Liubov Batanina's avatar Liubov Batanina

Support logSoftMax

parent f4147c99
...@@ -92,7 +92,8 @@ public: ...@@ -92,7 +92,8 @@ public:
{ {
return backendId == DNN_BACKEND_OPENCV || return backendId == DNN_BACKEND_OPENCV ||
(backendId == DNN_BACKEND_HALIDE && haveHalide() && axisRaw == 1) || (backendId == DNN_BACKEND_HALIDE && haveHalide() && axisRaw == 1) ||
((backendId == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019 || backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH) && haveInfEngine() && !logSoftMax); backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH ||
(backendId == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019 && haveInfEngine() && !logSoftMax);
} }
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL
...@@ -330,6 +331,9 @@ public: ...@@ -330,6 +331,9 @@ public:
auto& ieInpNode = nodes[0].dynamicCast<InfEngineNgraphNode>()->node; auto& ieInpNode = nodes[0].dynamicCast<InfEngineNgraphNode>()->node;
int axis = clamp(axisRaw, ieInpNode->get_shape().size()); int axis = clamp(axisRaw, ieInpNode->get_shape().size());
auto softmax = std::make_shared<ngraph::op::v1::Softmax>(ieInpNode, axis); auto softmax = std::make_shared<ngraph::op::v1::Softmax>(ieInpNode, axis);
if (logSoftMax)
return Ptr<BackendNode>(new InfEngineNgraphNode(std::make_shared<ngraph::op::v0::Log>(softmax)));
return Ptr<BackendNode>(new InfEngineNgraphNode(softmax)); return Ptr<BackendNode>(new InfEngineNgraphNode(softmax));
} }
#endif // HAVE_DNN_NGRAPH #endif // HAVE_DNN_NGRAPH
......
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