ArmNN
 24.02
BroadcastToLayer.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
9 
10 namespace armnn
11 {
12 
13  class BroadcastToLayer : public LayerWithParameters<BroadcastToDescriptor>
14  {
15  public:
16  /// Makes a workload for the BroadcastTo type.
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  BroadcastToLayer* Clone(Graph& graph) const override;
24 
25  /// Infers the output shapes from given input shapes and layer properties.
26  /// @param [in] inputShapes The input shapes layer has.
27  /// @return A vector to the inferred output shape.
28  std::vector<TensorShape> InferOutputShapes(const std::vector<TensorShape>& inputShapes) const override;
29 
30  /// Check if the input tensor BroadcastTo(s)
31  /// will lead to a valid configuration of @ref BroadcastToLayer.
32  void ValidateTensorShapesFromInputs() override;
33 
34  /// Execute Strategy on BroadcastTo layer
35  /// @param [in] strategy The input strategy for the layer
36  void ExecuteStrategy(IStrategy& strategy) const override;
37 
38  protected:
39  /// Constructor to create a BroadcastToLayer.
40  /// @param [in] param Parameters for the layer.
41  /// @param [in] name Optional name for the layer.
42  BroadcastToLayer(const BroadcastToDescriptor& param, const char* name);
43 
44  /// Default destructor.
45  ~BroadcastToLayer() = default;
46  };
47 
48 } // namespace armnn
armnn::BroadcastToLayer::~BroadcastToLayer
~BroadcastToLayer()=default
Default destructor.
armnn::BroadcastToLayer
Definition: BroadcastToLayer.hpp:13
armnn::BroadcastToLayer::InferOutputShapes
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
Infers the output shapes from given input shapes and layer properties.
Definition: BroadcastToLayer.cpp:33
armnn::IStrategy
Definition: IStrategy.hpp:16
armnn::LayerWithParameters
Definition: LayerWithParameters.hpp:14
armnn::BroadcastToLayer::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const override
Execute Strategy on BroadcastTo layer.
Definition: BroadcastToLayer.cpp:51
armnn::IWorkloadFactory
Definition: WorkloadFactory.hpp:22
LayerWithParameters.hpp
armnn::BroadcastToLayer::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the BroadcastTo type.
Definition: BroadcastToLayer.cpp:20
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::BroadcastToDescriptor
Definition: Descriptors.hpp:1659
armnn::BroadcastToLayer::Clone
BroadcastToLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Definition: BroadcastToLayer.cpp:28
armnn::BroadcastToLayer::ValidateTensorShapesFromInputs
void ValidateTensorShapesFromInputs() override
Check if the input tensor BroadcastTo(s) will lead to a valid configuration of BroadcastToLayer.
Definition: BroadcastToLayer.cpp:38
armnn::BroadcastToLayer::BroadcastToLayer
BroadcastToLayer(const BroadcastToDescriptor &param, const char *name)
Constructor to create a BroadcastToLayer.
Definition: BroadcastToLayer.cpp:16
armnn::Graph
Definition: Graph.hpp:30