ArmNN
 25.11
Loading...
Searching...
No Matches
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()

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
31 armnnUtils::FloatingPointConverter::ConvertFloat16To32(handle->GetConstTensor<Half>(),
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 }
static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer)

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


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