ArmNN
 20.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 Accept(ILayerVisitor& visitor) const override;
30 
31 
32 protected:
33  /// Constructor to create an ActivationLayer.
34  /// @param [in] param ActivationDescriptor to configure the activation operation.
35  /// @param [in] name Optional name for the layer.
36  ActivationLayer(const ActivationDescriptor &param, const char* name);
37 
38  /// Default destructor
39  ~ActivationLayer() = default;
40 };
41 
42 } // namespace
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of ActivationLayer.
This layer represents an activation operation with the specified activation function.
Copyright (c) 2020 ARM Limited.
~ActivationLayer()=default
Default destructor.
void Accept(ILayerVisitor &visitor) const override
Apply a visitor to this layer.
ActivationLayer(const ActivationDescriptor &param, const char *name)
Constructor to create an ActivationLayer.
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:20
ActivationLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Activation type.