[IE CLDNN] Add FP16 axes precision to Interpolate-4 (#2681)

JIRA: 40805
This commit is contained in:
Egor Churaev 2020-10-16 10:14:22 +03:00 committed by GitHub
parent ddd9cf6bf5
commit 73fceedf1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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";
}