ArmNN
 25.11
Loading...
Searching...
No Matches
ActivationLayer.hpp
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#pragma once
6
8
9namespace armnn
10{
11/// This layer represents an activation operation with the specified activation function.
12class ActivationLayer : public LayerWithParameters<ActivationDescriptor>
13{
14public:
15 /// Makes a workload for the Activation type.
16 /// @param [in] graph The graph where this layer can be found.
17 /// @param [in] factory The workload factory which will create the workload.
18 /// @return A pointer to the created workload, or nullptr if not created.
19 virtual std::unique_ptr<IWorkload> CreateWorkload(const IWorkloadFactory& factory) const override;
20
21 /// Creates a dynamically-allocated copy of this layer.
22 /// @param [in] graph The graph into which this layer is being cloned.
23 ActivationLayer* Clone(Graph& graph) const override;
24
25 /// Check if the input tensor shape(s) will lead to a valid configuration of @ref ActivationLayer.
26 /// @param [in] shapeInferenceMethod Indicates if output shape shall be overwritten or just validated.
27 void ValidateTensorShapesFromInputs() override;
28
29 void ExecuteStrategy(IStrategy& strategy) const override;
30
31protected:
32 /// Constructor to create an ActivationLayer.
33 /// @param [in] param ActivationDescriptor to configure the activation operation.
34 /// @param [in] name Optional name for the layer.
35 ActivationLayer(const ActivationDescriptor &param, const char* name);
36
37 /// Default destructor
38 ~ActivationLayer() = default;
39};
40
41} // namespace
~ActivationLayer()=default
Default destructor.
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of ActivationLayer.
ActivationLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
ActivationLayer(const ActivationDescriptor &param, const char *name)
Constructor to create an ActivationLayer.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Activation type.
LayerWithParameters(unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const ActivationDescriptor &param, const char *name)
Copyright (c) 2021 ARM Limited and Contributors.
An ActivationDescriptor for the ActivationLayer.