xref: /aosp_15_r20/external/armnn/src/armnn/layers/InputLayer.cpp (revision 89c4ff92f2867872bb9e2354d150bf0c8c502810)
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 
9 #include <armnn/backends/WorkloadData.hpp>
10 #include <armnn/backends/WorkloadFactory.hpp>
11 
12 namespace armnn
13 {
14 
InputLayer(LayerBindingId id,const char * name)15 InputLayer::InputLayer(LayerBindingId id, const char* name)
16     : BindableLayer(0, 1, LayerType::Input, name, id)
17 {
18 }
19 
CreateWorkload(const IWorkloadFactory & factory) const20 std::unique_ptr<IWorkload> InputLayer::CreateWorkload(const IWorkloadFactory& factory) const
21 {
22     IgnoreUnused(factory);
23     return nullptr;
24 }
25 
Clone(Graph & graph) const26 InputLayer* InputLayer::Clone(Graph& graph) const
27 {
28     return CloneBase<InputLayer>(graph, GetBindingId(), GetName());
29 }
30 
ValidateTensorShapesFromInputs()31 void InputLayer::ValidateTensorShapesFromInputs()
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 
ExecuteStrategy(IStrategy & strategy) const38 void InputLayer::ExecuteStrategy(IStrategy& strategy) const
39 {
40     strategy.ExecuteStrategy(this, GetParameters(), {}, GetName(), GetBindingId());
41 }
42 
43 } // namespace
44