ArmNN  NotReleased
StandInLayer.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "StandInLayer.hpp"
7 #include "LayerCloneBase.hpp"
8 
9 namespace armnn
10 {
11 
12 StandInLayer::StandInLayer(const StandInDescriptor& param, const char* name)
13  : LayerWithParameters(param.m_NumInputs, param.m_NumOutputs, LayerType::StandIn, param, name)
14 {
15 }
16 
17 std::unique_ptr<IWorkload> StandInLayer::CreateWorkload(const IWorkloadFactory& factory) const
18 {
19  boost::ignore_unused(factory);
20  // This throws in the event that it's called. We would expect that any backend that
21  // "claims" to support the StandInLayer type would actually substitute it with a PrecompiledLayer
22  // during graph optimization. There is no interface on the IWorkloadFactory to create a StandInWorkload.
23  throw Exception("Stand in layer does not support creating workloads");
24 }
25 
27 {
28  return CloneBase<StandInLayer>(graph, m_Param, GetName());
29 }
30 
31 std::vector<TensorShape> StandInLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const
32 {
33  boost::ignore_unused(inputShapes);
34  throw Exception("Stand in layer does not support infering output shapes");
35 }
36 
38 {
39  // Cannot validate this layer since no implementation details can be known by the framework
40  // so do nothing here.
41 }
42 
43 void StandInLayer::Accept(ILayerVisitor& visitor) const
44 {
45  visitor.VisitStandInLayer(this, GetParameters(), GetName());
46 }
47 } // namespace armnn
const char * GetName() const override
Definition: Layer.hpp:305
void ValidateTensorShapesFromInputs() override
StandInLayer(const StandInDescriptor &param, const char *name)
StandInLayer * Clone(Graph &graph) const override
const StandInDescriptor & GetParameters() const
StandInDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
virtual void VisitStandInLayer(const IConnectableLayer *layer, const StandInDescriptor &standInDescriptor, const char *name=nullptr)=0
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46
A StandInDescriptor for the StandIn layer.
This layer represents an unknown operation in the input graph.
void Accept(ILayerVisitor &visitor) const override
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override