From a09218d2d7f217bf4e0a695fa39fc0f2f80a41a5 Mon Sep 17 00:00:00 2001 From: Liubov Batanina Date: Wed, 24 Mar 2021 06:14:54 +0300 Subject: [PATCH] Added float16 to gather_tree reference (#4917) --- ngraph/core/reference/src/runtime/reference/gather_tree.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ngraph/core/reference/src/runtime/reference/gather_tree.cpp b/ngraph/core/reference/src/runtime/reference/gather_tree.cpp index 784f8ce2290..42f6c4ab528 100644 --- a/ngraph/core/reference/src/runtime/reference/gather_tree.cpp +++ b/ngraph/core/reference/src/runtime/reference/gather_tree.cpp @@ -29,6 +29,12 @@ static size_t _asIndex(const char* source, const element::Type& element_type) // According to the GatherTree op specification only I32 and FP32 precisions are supported. switch (element_type) { + case element::Type_t::f16: + { + ngraph::float16 tmpBuff = 0.f; + memcpy(&tmpBuff, source, sizeof(ngraph::float16)); + return tmpBuff; + } case element::Type_t::f32: { float tmpBuff = 0.f;