ArmNN
 24.02
Float16ToFloat32 Struct Reference

#include <ConvertConstants.hpp>

Static Public Member Functions

static void Func (std::shared_ptr< ConstTensorHandle > &handle)
 

Detailed Description

Definition at line 21 of file ConvertConstants.hpp.

Member Function Documentation

◆ Func()

static void Func ( std::shared_ptr< ConstTensorHandle > &  handle)
inlinestatic

Definition at line 23 of file ConvertConstants.hpp.

24  {
25  const TensorInfo& info = handle->GetTensorInfo();
26 
27  if (info.GetDataType() == DataType::Float16)
28  {
29  std::vector<float> newValues(info.GetNumElements());
30 
32  info.GetNumElements(),
33  newValues.data());
34 
35  TensorInfo newInfo(info.GetShape(), DataType::Float32, 0.0f, 0, true);
36  ConstTensor newInput(newInfo, newValues);
37  handle.reset(new ScopedTensorHandle(newInput));
38  }
39  }

References FloatingPointConverter::ConvertFloat16To32(), armnn::Float16, armnn::Float32, and armnn::info.


The documentation for this struct was generated from the following file:
armnn::DataType::Float32
@ Float32
armnn::Half
half_float::half Half
Definition: Half.hpp:22
armnn::DataType::Float16
@ Float16
armnnUtils::FloatingPointConverter::ConvertFloat16To32
static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer)
Definition: FloatingPointConverter.cpp:43
armnn::BoostLogSeverityMapping::info
@ info