ArmNN
 24.02
OutputLayer.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include "OutputLayer.hpp"
6 
7 #include "LayerCloneBase.hpp"
8 
12 
13 namespace armnn
14 {
15 
17  : BindableLayer(1, 0, LayerType::Output, name, id)
18 {
19 }
20 
21 std::unique_ptr<IWorkload> OutputLayer::CreateWorkload(const IWorkloadFactory& factory) const
22 {
23  IgnoreUnused(factory);
24  return nullptr;
25 }
26 
28 {
29  return CloneBase<OutputLayer>(graph, GetBindingId(), GetName());
30 }
31 
33 {
34 
35  // Just validates that the input is connected.
36  ConditionalThrow<LayerValidationException>(GetInputSlot(0).GetConnection() != nullptr,
37  "OutputLayer: Input slot must be connected.");
38 }
39 
41 {
42  strategy.ExecuteStrategy(this, GetParameters(), {}, GetName(), GetBindingId());
43 }
44 
45 } // namespace armnn
armnn::BindableLayer
Definition: Layer.hpp:470
WorkloadData.hpp
armnn::OutputLayer::ValidateTensorShapesFromInputs
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of OutputLayer.
Definition: OutputLayer.cpp:32
IgnoreUnused.hpp
armnn::OutputLayer::OutputLayer
OutputLayer(LayerBindingId id, const char *name)
Constructor to create an OutputLayer.
Definition: OutputLayer.cpp:16
armnn::IStrategy
Definition: IStrategy.hpp:16
armnn::Layer::GetInputSlot
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
Definition: Layer.hpp:337
WorkloadFactory.hpp
armnn::Layer::GetName
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:332
armnn::OutputLayer
A layer user-provided data can be bound to (e.g. inputs, outputs).
Definition: OutputLayer.hpp:13
armnn::IWorkloadFactory
Definition: WorkloadFactory.hpp:22
armnn::LayerBindingId
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:309
armnn::BindableLayer::GetBindingId
LayerBindingId GetBindingId() const
Definition: Layer.hpp:483
armnn::Layer::GetParameters
virtual const BaseDescriptor & GetParameters() const override
If the layer has a descriptor return it.
Definition: Layer.hpp:378
armnn::IgnoreUnused
void IgnoreUnused(Ts &&...)
Definition: IgnoreUnused.hpp:14
OutputLayer.hpp
armnn::OutputLayer::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
Definition: OutputLayer.cpp:40
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::OutputLayer::Clone
OutputLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Definition: OutputLayer.cpp:27
armnn::OutputLayer::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Returns nullptr for Output type.
Definition: OutputLayer.cpp:21
armnn::LayerType
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
Definition: Types.hpp:491
armnn::Graph
Definition: Graph.hpp:30
armnn::IStrategy::ExecuteStrategy
virtual void ExecuteStrategy(const IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0)=0
LayerCloneBase.hpp
armnn::LayerType::Output
@ Output