ArmNN
 20.02
ElementwiseBaseLayer.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <Layer.hpp>
9 
10 namespace armnn
11 {
12 
13 /// NOTE: this is an abstract class to encapsulate the element wise operations, it does not implement:
14 /// std::unique_ptr<IWorkload> Layer::CreateWorkload(const IWorkloadFactory& factory) const = 0;
15 /// Layer* Clone(Graph& graph) const = 0;
17 {
18 public:
19  /// Check if the input tensor shape(s)
20  /// will lead to a valid configuration of the element wise operation.
21  void ValidateTensorShapesFromInputs() override;
22 
23  /// By default returns inputShapes if the number of inputs are equal to number of outputs,
24  /// otherwise infers the output shapes from given input shapes and layer properties.
25  /// @param [in] inputShapes The input shapes layer has.
26  /// @return A vector to the inferred output shape.
27  std::vector<TensorShape> InferOutputShapes(const std::vector<TensorShape>& inputShapes) const override;
28 
29 protected:
30  /// @param numInputSlots The number of input slots for the layer.
31  /// @param numOutputSlots The number of output slots for the layer.
32  /// @param type The layer type.
33  /// @param name Optional name for the layer.
34  ElementwiseBaseLayer(unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const char* name);
35 
36  /// Default destructor
37  ~ElementwiseBaseLayer() = default;
38 };
39 
40 } // namespace
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
By default returns inputShapes if the number of inputs are equal to number of outputs, otherwise infers the output shapes from given input shapes and layer properties.
Copyright (c) 2020 ARM Limited.
NOTE: this is an abstract class to encapsulate the element wise operations, it does not implement: st...
ElementwiseBaseLayer(unsigned int numInputSlots, unsigned int numOutputSlots, LayerType type, const char *name)
~ElementwiseBaseLayer()=default
Default destructor.
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of the element wise operation...