14 namespace optimizations
32 ReplaceConvertFp32ToBf16Layer<DataType::BFloat16>(
34 PolymorphicDowncast<ConstantLayer*>(&base),
35 PolymorphicDowncast<ConvertFp32ToBf16Layer*>(&child));
39 std::string(
" Constant Layer cannot be fused into ") +
41 std::string(
" conversion layer."));
50 static void ReplaceConvertFp32ToBf16Layer(
Graph& graph,
62 std::vector<T> newValues(outputConvertFp32ToBf16Info.
GetNumElements());
68 TensorInfo newInfo = outputConvertFp32ToBf16Info;
A layer that the constant data can be bound to.
std::shared_ptr< ConstTensorHandle > m_LayerOutput
Layer & GetOwningLayer() const
typename ResolveTypeImpl< DT >::Type ResolveType
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
constexpr const char * GetDataTypeName(DataType dataType)
void Run(Graph &graph, InputSlot &connection) 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 ConvertFloat32ToBFloat16(const float *srcFloat32Buffer, size_t numElements, void *dstBFloat16Buffer)
FuseConvertFp32ToBf16IntoConstLayers()=default
void SetTensorInfo(const TensorInfo &tensorInfo) override
void SetConstant(const bool IsConstant=true)
Marks the data corresponding to this tensor info as constant.
DataType GetDataType() const
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
This layer converts data type Float32 to BFloat16.
const TensorInfo & GetTensorInfo() const override
void MoveAllConnections(OutputSlot &destination)
Moves all connections to another OutputSlot.
unsigned int GetNumElements() const
~FuseConvertFp32ToBf16IntoConstLayers()=default