ArmNN
 20.11
Float16ToFloat32 Struct Reference

#include <ConvertConstants.hpp>

Static Public Member Functions

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

Detailed Description

Definition at line 45 of file ConvertConstants.hpp.

Member Function Documentation

◆ Func()

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

Definition at line 47 of file ConvertConstants.hpp.

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

48  {
49  const TensorInfo& info = handle->GetTensorInfo();
50 
51  if (info.GetDataType() == DataType::Float16)
52  {
53  std::vector<float> newValues(info.GetNumElements());
54 
56  info.GetNumElements(),
57  newValues.data());
58 
59  TensorInfo newInfo(info.GetShape(), DataType::Float32);
60  ConstTensor newInput(newInfo, newValues);
61  handle.reset(new ScopedCpuTensorHandle(newInput));
62  }
63  }
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: