ArmNN
 20.02
Float16ToFloat32 Struct Reference

#include <ConvertConstants.hpp>

Static Public Member Functions

static void Func (std::unique_ptr< ScopedCpuTensorHandle > &handle)
 

Detailed Description

Definition at line 23 of file ConvertConstants.hpp.

Member Function Documentation

◆ Func()

static void Func ( std::unique_ptr< ScopedCpuTensorHandle > &  handle)
inlinestatic

Definition at line 25 of file ConvertConstants.hpp.

References FloatingPointConverter::ConvertFloat16To32(), armnn::Float16, armnn::Float32, TensorInfo::GetDataType(), TensorInfo::GetNumElements(), TensorInfo::GetShape(), and armnn::info.

26  {
27  const TensorInfo& info = handle->GetTensorInfo();
28 
29  if (info.GetDataType() == DataType::Float16)
30  {
31  std::vector<float> newValues(info.GetNumElements());
32 
34  info.GetNumElements(),
35  newValues.data());
36 
37  TensorInfo newInfo(info.GetShape(), DataType::Float32);
38  ConstTensor newInput(newInfo, newValues);
39  handle.reset(new ScopedCpuTensorHandle(newInput));
40  }
41  }
static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer)
half_float::half Half
Definition: Half.hpp:16

The documentation for this struct was generated from the following file: