ArmNN  NotReleased
DepthwiseConvolution2dLayer.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
8 
9 namespace armnn
10 {
11 
12 class ScopedCpuTensorHandle;
13 
15 class DepthwiseConvolution2dLayer : public LayerWithParameters<DepthwiseConvolution2dDescriptor>
16 {
17 public:
19  std::unique_ptr<ScopedCpuTensorHandle> m_Weight;
21  std::unique_ptr<ScopedCpuTensorHandle> m_Bias;
22 
27  virtual std::unique_ptr<IWorkload> CreateWorkload(const IWorkloadFactory& factory) const override;
28 
31  DepthwiseConvolution2dLayer* Clone(Graph& graph) const override;
32 
35  void ValidateTensorShapesFromInputs() override;
36 
41  std::vector<TensorShape> InferOutputShapes(const std::vector<TensorShape>& inputShapes) const override;
42 
43  void Accept(ILayerVisitor& visitor) const override;
44 
46 
47 protected:
51  DepthwiseConvolution2dLayer(const DepthwiseConvolution2dDescriptor& param, const char* name);
52 
54  ~DepthwiseConvolution2dLayer() = default;
55 
59 };
60 
61 } // namespace
void Accept(ILayerVisitor &visitor) const override
DepthwiseConvolution2dLayer * Clone(Graph &graph) const override
This layer represents a depthwise convolution 2d operation.
std::unique_ptr< ScopedCpuTensorHandle > m_Bias
A unique pointer to store Bias values.
std::unique_ptr< ScopedCpuTensorHandle > m_Weight
A unique pointer to store Weight values.
DepthwiseConvolution2dLayer(const DepthwiseConvolution2dDescriptor &param, const char *name)
std::vector< std::reference_wrapper< std::unique_ptr< ScopedCpuTensorHandle > >> ConstantTensors
Definition: Layer.hpp:356
void SerializeLayerParameters(ParameterStringifyFunction &fn) const override
~DepthwiseConvolution2dLayer()=default
Default destructor.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
std::function< void(const std::string &name, const std::string &value)> ParameterStringifyFunction
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.