ArmNN
 21.02
SubtractionLayer.cpp
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 
6 #include "SubtractionLayer.hpp"
7 
8 #include "LayerCloneBase.hpp"
9 
10 #include <armnn/TypesUtils.hpp>
13 
14 namespace armnn
15 {
16 
19 {
20 }
21 
22 std::unique_ptr<IWorkload> SubtractionLayer::CreateWorkload(const IWorkloadFactory& factory) const
23 {
24  SubtractionQueueDescriptor descriptor;
25  SetAdditionalInfo(descriptor);
26 
27  return factory.CreateSubtraction(descriptor, PrepInfoAndDesc(descriptor));
28 }
29 
31 {
32  return CloneBase<SubtractionLayer>(graph, GetName());
33 }
34 
36 {
37  visitor.VisitSubtractionLayer(this, GetName());
38 }
39 
40 } // namespace armnn
SubtractionLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
virtual void VisitSubtractionLayer(const IConnectableLayer *layer, const char *name=nullptr)=0
Function a subtraction layer should call back to when its Accept(ILayerVisitor&) function is invoked...
Copyright (c) 2021 ARM Limited and Contributors.
void Accept(ILayerVisitor &visitor) const override
Apply a visitor to this layer.
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
Definition: Layer.hpp:381
SubtractionLayer(const char *name)
Constructor to create a SubtractionLayer.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Subtraction type.
void SetAdditionalInfo(QueueDescriptor &descriptor) const
Definition: Layer.cpp:245
This layer represents a subtraction operation.
NOTE: this is an abstract class to encapsulate the element wise operations, it does not implement: st...
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:311
virtual std::unique_ptr< IWorkload > CreateSubtraction(const SubtractionQueueDescriptor &descriptor, const WorkloadInfo &info) const
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below...
Definition: Types.hpp:419