2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
7 #include "LayerWithParameters.hpp"
12 class PermuteLayer : public LayerWithParameters<PermuteDescriptor>
15 virtual std::unique_ptr<IWorkload> CreateWorkload(const Graph& graph,
16 const IWorkloadFactory& factory) const override;
18 PermuteLayer* Clone(Graph& graph) const override;
20 void ValidateTensorShapesFromInputs() override;
21 std::vector<TensorShape> InferOutputShapes(const std::vector<TensorShape>& inputShapes) const override;
23 const PermutationVector& GetPermutation() const
25 return m_Param.m_DimMappings;
28 bool IsInverse(const Layer& other) const
30 return (other.GetType() == LayerType::Permute) &&
31 GetPermutation().IsInverse(boost::polymorphic_downcast<const PermuteLayer*>(&other)->GetPermutation());
34 bool IsEqual(const Layer& other) const
36 return (other.GetType() == LayerType::Permute) &&
37 GetPermutation().IsEqual(boost::polymorphic_downcast<const PermuteLayer*>(&other)->GetPermutation());
41 PermuteLayer(const PermuteDescriptor& param, const char* name);
42 ~PermuteLayer() = default;