ArmNN
 24.08
InputLayer.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 "InputLayer.hpp"
6 
7 #include "LayerCloneBase.hpp"
8 
11 
12 namespace armnn
13 {
14 
16  : BindableLayer(0, 1, LayerType::Input, name, id)
17 {
18 }
19 
20 std::unique_ptr<IWorkload> InputLayer::CreateWorkload(const IWorkloadFactory& factory) const
21 {
22  IgnoreUnused(factory);
23  return nullptr;
24 }
25 
27 {
28  return CloneBase<InputLayer>(graph, GetBindingId(), GetName());
29 }
30 
32 {
33  //The input layer should already have it's inputs set during graph building phase in the driver/parser.
34  ConditionalThrow<LayerValidationException>(GetOutputHandler(0).IsTensorInfoSet(),
35  "InputLayer should already have the TensorInfo set.");
36 }
37 
39 {
40  strategy.ExecuteStrategy(this, GetParameters(), {}, GetName(), GetBindingId());
41 }
42 
43 } // namespace
armnn::BindableLayer
Definition: Layer.hpp:470
armnn::InputLayer
A layer user-provided data can be bound to (e.g. inputs, outputs).
Definition: InputLayer.hpp:13
WorkloadData.hpp
armnn::InputLayer::Clone
InputLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Definition: InputLayer.cpp:26
armnn::IStrategy
Definition: IStrategy.hpp:16
WorkloadFactory.hpp
armnn::Layer::GetName
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:332
armnn::IWorkloadFactory
Definition: WorkloadFactory.hpp:22
armnn::LayerBindingId
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:309
armnn::Layer::GetOutputHandler
const OutputHandler & GetOutputHandler(unsigned int i=0) const
Definition: Layer.hpp:245
armnn::BindableLayer::GetBindingId
LayerBindingId GetBindingId() const
Definition: Layer.hpp:483
armnn::InputLayer::ValidateTensorShapesFromInputs
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of InputLayer.
Definition: InputLayer.cpp:31
armnn::Layer::GetParameters
virtual const BaseDescriptor & GetParameters() const override
If the layer has a descriptor return it.
Definition: Layer.hpp:378
armnn::InputLayer::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Input type.
Definition: InputLayer.cpp:20
armnn::IgnoreUnused
void IgnoreUnused(Ts &&...)
Definition: IgnoreUnused.hpp:14
armnn::InputLayer::InputLayer
InputLayer(LayerBindingId id, const char *name)
Constructor to create an InputLayer.
Definition: InputLayer.cpp:15
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
InputLayer.hpp
armnn::InputLayer::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
Definition: InputLayer.cpp:38
armnn::LayerType::Input
@ Input
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