ArmNN
 25.11
Loading...
Searching...
No Matches
StandInLayer.cpp
Go to the documentation of this file.
1//
2// Copyright © 2019 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "StandInLayer.hpp"
7#include "LayerCloneBase.hpp"
8
9namespace armnn
10{
11
12StandInLayer::StandInLayer(const StandInDescriptor& param, const char* name)
13 : LayerWithParameters(param.m_NumInputs, param.m_NumOutputs, LayerType::StandIn, param, name)
14{
15}
16
17std::unique_ptr<IWorkload> StandInLayer::CreateWorkload(const IWorkloadFactory& factory) const
18{
19 IgnoreUnused(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
31std::vector<TensorShape> StandInLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const
32{
33 IgnoreUnused(inputShapes);
34 throw Exception("Stand in layer does not support infering output shapes");
35}
36
38{
39
40 // Cannot validate this layer since no implementation details can be known by the framework
41 // so do nothing here.
42}
43
45{
46 strategy.ExecuteStrategy(this, GetParameters(), {}, GetName());
47}
48
49} // namespace armnn
Base class for all ArmNN exceptions so that users can filter to just those.
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
LayerType * CloneBase(Graph &graph, Params &&... params) const
const char * GetName() const override
Returns the name of the layer.
Definition Layer.hpp:332
LayerWithParameters(unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const StandInDescriptor &param, const char *name)
const StandInDescriptor & GetParameters() const override
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
Empty implementation that throws Exception if called.
StandInLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) Does nothing since cannot validate any properties of this layer.
StandInLayer(const StandInDescriptor &param, const char *name)
Constructor to create a StandInLayer.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Empty implementation explictly does NOT create a workload.
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 &&...)
A StandInDescriptor for the StandIn layer.