aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-02-11 12:21:27 +0000
committerAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-02-11 13:33:20 +0000
commit0085978ac40ecd008195d635cd009a1d4f49fb74 (patch)
tree560c296e74b94826d6338b7d0d92224ae526a426 /include
parent3dad5acc5d8eda6fc472b9a255c1d893d4e1f942 (diff)
downloadarmnn-0085978ac40ecd008195d635cd009a1d4f49fb74.tar.gz
IVGCVSW-2676 Make biases optional in ILayerVisitor for Convolution2D, DepthwiseConvolution2D and FullyConnected
Change-Id: I3048504ff699fdb266488e7c07b7262e5843d4b0 Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com>
Diffstat (limited to 'include')
-rw-r--r--include/armnn/ILayerVisitor.hpp50
1 files changed, 9 insertions, 41 deletions
diff --git a/include/armnn/ILayerVisitor.hpp b/include/armnn/ILayerVisitor.hpp
index 3b92733a81..c0350d253a 100644
--- a/include/armnn/ILayerVisitor.hpp
+++ b/include/armnn/ILayerVisitor.hpp
@@ -6,6 +6,7 @@
#include <armnn/NetworkFwd.hpp>
#include <armnn/DescriptorsFwd.hpp>
+#include <armnn/Optional.hpp>
#include <armnn/TensorFwd.hpp>
#include <armnn/Types.hpp>
@@ -27,52 +28,30 @@ public:
LayerBindingId id,
const char* name = nullptr) = 0;
- /// Function that a 2D convolution layer without biases should call back to when its Accept(ILayerVisitor&)
+ /// Function that a 2D convolution layer should call back to when its Accept(ILayerVisitor&)
/// function is invoked.
/// @param layer - pointer to the layer which is calling back to this visit function.
/// @param convolution2dDescriptor - Description of the 2D convolution layer.
/// @param weights - Tensor for the weights data.
+ /// @param biases - Optional tensor for the bias data. If specified, must match the output tensor shape.
/// @param name - Optional name for the layer.
virtual void VisitConvolution2dLayer(const IConnectableLayer* layer,
const Convolution2dDescriptor& convolution2dDescriptor,
const ConstTensor& weights,
+ const Optional<ConstTensor>& biases,
const char* name = nullptr) = 0;
- /// Function that a 2D convolution layer with bias should call back to when its Accept(ILayerVisitor&)
- /// function is invoked.
- /// @param layer - pointer to the layer which is calling back to this visit function.
- /// @param convolution2dDescriptor - Description of the 2D convolution layer.
- /// @param weights - Tensor for the weights data.
- /// @param biases - Tensor for the bias data. Must match the output tensor shape.
- /// @param name - Optional name for the layer.
- virtual void VisitConvolution2dLayer(const IConnectableLayer* layer,
- const Convolution2dDescriptor& convolution2dDescriptor,
- const ConstTensor& weights,
- const ConstTensor& biases,
- const char* name = nullptr) = 0;
-
- /// Function that a 2D depthwise convolution layer without biases should call back to when its
- /// Accept(ILayerVisitor&) function is invoked.
- /// @param layer - pointer to the layer which is calling back to this visit function.
- /// @param convolution2dDescriptor - Description of the 2D depthwise convolution layer.
- /// @param weights - Tensor for the weights. Expected format: [channelMultiplier, inputChannels, height, width].
- /// @param name - Optional name for the layer.
- virtual void VisitDepthwiseConvolution2dLayer(const IConnectableLayer* layer,
- const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
- const ConstTensor& weights,
- const char* name = nullptr) = 0;
-
/// Function that a 2D depthwise convolution layer with biases should call back to when its
/// Accept(ILayerVisitor&) function is invoked.
/// @param layer - pointer to the layer which is calling back to this visit function.
/// @param convolution2dDescriptor - Description of the 2D depthwise convolution layer.
/// @param weights - Tensor for the weights. Expected format: [channelMultiplier, inputChannels, height, width].
- /// @param biases - Tensor for the bias data. Must match the output tensor shape.
+ /// @param biases - Optional tensor for the bias data. If specified, must match the output tensor shape.
/// @param name - Optional name for the layer.
virtual void VisitDepthwiseConvolution2dLayer(const IConnectableLayer* layer,
const DepthwiseConvolution2dDescriptor& convolution2dDescriptor,
const ConstTensor& weights,
- const ConstTensor& biases,
+ const Optional<ConstTensor>& biases,
const char* name = nullptr) = 0;
/// Function that a Detection PostProcess layer should call back to when its
@@ -86,28 +65,17 @@ public:
const ConstTensor& anchors,
const char* name = nullptr) = 0;
- /// Function that a fully connected layer without biases should call back to when its Accept(ILayerVisitor&)
- /// function is invoked.
- /// @param layer - pointer to the layer which is calling back to this visit function.
- /// @param fullyConnectedDescriptor - Description of the fully connected layer.
- /// @param weights - Tensor for the weights data.
- /// @param name - Optional name for the layer.
- virtual void VisitFullyConnectedLayer(const IConnectableLayer* layer,
- const FullyConnectedDescriptor& fullyConnectedDescriptor,
- const ConstTensor& weights,
- const char* name = nullptr) = 0;
-
- /// Function that a fully connected layer with biases should call back to when its Accept(ILayerVisitor&)
+ /// Function that a fully connected layer should call back to when its Accept(ILayerVisitor&)
/// function is invoked.
/// @param layer - pointer to the layer which is calling back to this visit function.
/// @param fullyConnectedDescriptor - Description of the fully connected layer.
/// @param weights - Tensor for the weights data.
- /// @param biases - Tensor for the bias data.
+ /// @param biases - Optional tensor for the bias data.
/// @param name - Optional name for the layer.
virtual void VisitFullyConnectedLayer(const IConnectableLayer* layer,
const FullyConnectedDescriptor& fullyConnectedDescriptor,
const ConstTensor& weights,
- const ConstTensor& biases,
+ const Optional<ConstTensor>& biases,
const char* name = nullptr) = 0;
/// Function that a permute layer should call back to when its Accept(ILayerVisitor&) function is invoked.