Added float16 to gather_tree reference (#4917)

This commit is contained in:
Liubov Batanina 2021-03-24 06:14:54 +03:00 committed by GitHub
parent 345f816709
commit a09218d2d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;