ArmNN
 25.11
Loading...
Searching...
No Matches
UnmapLayer.cpp
Go to the documentation of this file.
1//
2// Copyright © 2020,2024 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#include "UnmapLayer.hpp"
6
7#include "LayerCloneBase.hpp"
8
13
14namespace armnn
15{
16
17UnmapLayer::UnmapLayer(const char* name)
18 : Layer(1, 0, LayerType::Unmap, name)
19{
20}
21
23{
24 return CloneBase<UnmapLayer>(graph, GetName());
25}
26
27std::unique_ptr<IWorkload> UnmapLayer::CreateWorkload(const IWorkloadFactory& factory) const
28{
29 IgnoreUnused(factory);
30 UnmapQueueDescriptor descriptor;
31 SetAdditionalInfo(descriptor);
32
33 //This is different from other workloads. Does not get created by the workload factory.
34 return std::make_unique<UnmapWorkload>(descriptor, PrepInfoAndDesc(descriptor));
35}
36
38{
39 // validates that the input is connected.
41 if (GetNumOutputSlots() != 0)
42 {
43 throw armnn::LayerValidationException("Output slots must be \"0\" - currently \""
44 + std::to_string(GetNumOutputSlots()) + "\".");
45 }
46}
47
49{
50 IgnoreUnused(strategy);
51 throw armnn::Exception("UnmapLayer should not appear in an input graph");
52}
53
54} // namespace armnn
#define CHECK_LOCATION()
Base class for all ArmNN exceptions so that users can filter to just those.
void VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation &location) const
Definition Layer.cpp:410
unsigned int GetNumOutputSlots() const override
Returns the number of connectable output slots.
Definition Layer.hpp:335
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
Definition Layer.hpp:409
Layer(unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const char *name)
Definition Layer.cpp:260
LayerType * CloneBase(Graph &graph, Params &&... params) const
const char * GetName() const override
Returns the name of the layer.
Definition Layer.hpp:332
void SetAdditionalInfo(QueueDescriptor &descriptor) const
Definition Layer.cpp:303
friend class Graph
Definition Layer.hpp:382
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of UnmapLayer.
UnmapLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
UnmapLayer(const char *name)
Constructor to create a UnmapLayer.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Unmap type.
Copyright (c) 2021 ARM Limited and Contributors.
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
Definition Types.hpp:494
void IgnoreUnused(Ts &&...)