aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/layers/FusedLayer.cpp
blob: 37b1835450e701fe7aab97ee64ab6cdb925d0455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "FusedLayer.hpp"
#include "LayerCloneBase.hpp"

#include <armnn/backends/Workload.hpp>
#include <armnn/TypesUtils.hpp>

namespace armnn
{

FusedLayer::FusedLayer(const FusedDescriptor& param, const char* name)
    : LayerWithParameters(param.m_NumInputSlots, param.m_NumOutputSlots, LayerType::Fused, param, name)
{}

FusedLayer::~FusedLayer()
{}

FusedLayer* FusedLayer::Clone(Graph& graph) const
{
    FusedLayer* clonedLayer = CloneBase<FusedLayer>(graph, m_Param, GetName());
    clonedLayer->m_AdditionalInfoObject = const_cast<FusedLayer*>(this)->m_AdditionalInfoObject;
    return clonedLayer;
}

std::unique_ptr<IWorkload> FusedLayer::CreateWorkload(const armnn::IWorkloadFactory& factory) const
{
    FusedQueueDescriptor descriptor;
    SetAdditionalInfo(descriptor);

    return factory.CreateWorkload(LayerType::Fused, descriptor, PrepInfoAndDesc(descriptor));
}

void FusedLayer::ValidateTensorShapesFromInputs()
{
    // NOTE: since the FusedLayer is an internal layer created from a valid SubgraphView,
    // we do not need to validate its input shapes
}

void FusedLayer::ExecuteStrategy(IStrategy& strategy) const
{
    strategy.ExecuteStrategy(this, GetParameters(), {}, GetName());
}

} // namespace armnn