ArmNN
 24.08
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 
9 namespace armnn
10 {
11 /// This layer represents an activation operation with the specified activation function.
12 class ActivationLayer : public LayerWithParameters<ActivationDescriptor>
13 {
14 public:
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 
31 protected:
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
armnn::ActivationDescriptor
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:36
armnn::ActivationLayer::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Activation type.
Definition: ActivationLayer.cpp:20
armnn::ActivationLayer::~ActivationLayer
~ActivationLayer()=default
Default destructor.
armnn::IStrategy
Definition: IStrategy.hpp:16
armnn::LayerWithParameters
Definition: LayerWithParameters.hpp:14
armnn::IWorkloadFactory
Definition: WorkloadFactory.hpp:22
armnn::ActivationLayer::ActivationLayer
ActivationLayer(const ActivationDescriptor &param, const char *name)
Constructor to create an ActivationLayer.
Definition: ActivationLayer.cpp:15
LayerWithParameters.hpp
armnn::ActivationLayer::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
Definition: ActivationLayer.cpp:53
armnn::ActivationLayer
This layer represents an activation operation with the specified activation function.
Definition: ActivationLayer.hpp:12
armnn::ActivationLayer::ValidateTensorShapesFromInputs
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of ActivationLayer.
Definition: ActivationLayer.cpp:33
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::Graph
Definition: Graph.hpp:30
armnn::ActivationLayer::Clone
ActivationLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Definition: ActivationLayer.cpp:28