12 namespace optimizations
26 ReplaceConstDequantisationLayer(graph,
27 PolymorphicDowncast<ConstantLayer*>(&base),
28 PolymorphicDowncast<DequantizeLayer*>(&child));
36 static void ReplaceConstDequantisationLayer(
Graph& graph,
53 std::vector<float> newValues(outputDequantizeInfo.
GetNumElements());
96 static void ConvertInt8To32(
const void* srcInt8Buffer,
98 float* dstFloat32Buffer)
103 const auto* pInt8 =
static_cast<const int8_t*
>(srcInt8Buffer);
105 for (
size_t i = 0; i < numElements; ++i)
107 dstFloat32Buffer[i] = pInt8[i];
A layer that the constant data can be bound to.
std::shared_ptr< ConstTensorHandle > m_LayerOutput
Layer & GetOwningLayer() const
void Run(Graph &graph, InputSlot &connection) const
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
unsigned int GetNumOutputSlots() const override
Returns the number of connectable output slots.
unsigned int GetNumConnections() const override
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
This layer dequantizes the input tensor.
DataType GetDataType() const
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
#define ARMNN_ASSERT(COND)
static void ConvertFloat16To32(const void *srcFloat16Buffer, size_t numElements, float *dstFloat32Buffer)
ConvertConstDequantisationLayersToConstLayersImpl()=default
void SetTensorInfo(const TensorInfo &tensorInfo) override
void SetConstant(const bool IsConstant=true)
Marks the data corresponding to this tensor info as constant.
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
~ConvertConstDequantisationLayersToConstLayersImpl()=default
const TensorInfo & GetTensorInfo() const override
void MoveAllConnections(OutputSlot &destination)
Moves all connections to another OutputSlot.
const InputSlot * GetConnection(unsigned int index) const override
unsigned int GetNumElements() const