ArmNN  NotReleased
ReshapeLayer.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 
13 class ReshapeLayer : public LayerWithParameters<ReshapeDescriptor>
14 {
15 public:
20  virtual std::unique_ptr<IWorkload> CreateWorkload(const IWorkloadFactory& factory) const override;
21 
24  ReshapeLayer* Clone(Graph& graph) const override;
25 
28  void ValidateTensorShapesFromInputs() override;
29 
34  std::vector<TensorShape> InferOutputShapes(const std::vector<TensorShape>& inputShapes) const override;
35 
39  bool IsEqual(const Layer& other) const
40  {
41  return (other.GetType() == LayerType::Reshape) &&
42  m_Param.m_TargetShape == boost::polymorphic_downcast<const ReshapeLayer*>(&other)->m_Param.m_TargetShape;
43  }
44 
45  void Accept(ILayerVisitor& visitor) const override;
46 
47 protected:
51  ReshapeLayer(const ReshapeDescriptor& desc, const char* name);
52 
54  ~ReshapeLayer() = default;
55 };
56 
57 } // namespace
LayerType GetType() const
Definition: Layer.hpp:259
bool IsEqual(const Layer &other) const
void ValidateTensorShapesFromInputs() override
This layer represents a reshape operation.
void Accept(ILayerVisitor &visitor) const override
ReshapeLayer * Clone(Graph &graph) const override
A ReshapeDescriptor for the ReshapeLayer.
TensorShape m_TargetShape
Target shape value.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
ReshapeLayer(const ReshapeDescriptor &desc, const char *name)
ReshapeDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
~ReshapeLayer()=default
Default destructor.