ArmNN
 25.02
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
BroadcastToLayer(const BroadcastToDescriptor &param, const char *name)
Constructor to create a BroadcastToLayer.
void ExecuteStrategy(IStrategy &strategy) const override
Execute Strategy on BroadcastTo layer.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
Infers the output shapes from given input shapes and layer properties.
void ValidateTensorShapesFromInputs() override
Check if the input tensor BroadcastTo(s) will lead to a valid configuration of BroadcastToLayer.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the BroadcastTo type.
~BroadcastToLayer()=default
Default destructor.
BroadcastToLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Copyright (c) 2021 ARM Limited and Contributors.