[IE CLDNN] Add FP16 axes precision to Interpolate-4 (#2681)
authorEgor Churaev <egor.churaev@intel.com>
Fri, 16 Oct 2020 07:14:22 +0000 (10:14 +0300)
committerGitHub <noreply@github.com>
Fri, 16 Oct 2020 07:14:22 +0000 (10:14 +0300)
JIRA: 40805

inference-engine/src/cldnn_engine/cldnn_program.cpp

index b78288b..cda4ab7 100644 (file)
@@ -3487,6 +3487,10 @@ void Program::CreateInterpolatePrimitive(cldnn::topology& topology, InferenceEng
             auto data = constantBlob->buffer().as<float*>();
             for (size_t i = 0; i < constantBlob->size(); ++i)
                 scales.push_back(data[i]);
+        } else if (axesPrecision == InferenceEngine::Precision::FP16) {
+            auto data = static_cast<const uint16_t *>(constantBlob->buffer());
+            for (size_t i = 0; i < constantBlob->size(); ++i)
+                scales.push_back(cldnn::half_to_float(data[i]));
         } else {
             THROW_IE_EXCEPTION << layer->name << " Incorrect scales input precision";
         }