diff options
author | Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> | 2019-02-22 17:03:44 +0000 |
---|---|---|
committer | Aron Virginas-Tar <aron.virginas-tar@arm.com> | 2019-02-27 14:39:42 +0000 |
commit | ad402709dc137a001cab024cd3b4ad97132a2bf0 (patch) | |
tree | 16102291542725726dda37568418ec8824a1f88e /include | |
parent | b56292c0040aa125cdaafcee1a4299c5cd144200 (diff) | |
download | armnn-ad402709dc137a001cab024cd3b4ad97132a2bf0.tar.gz |
IVGCVSW-2752 Make biases optional in INetwork
* Added new version of AddConvolution2dLayer, AddDepthwiseConvolution2dLayer
and AddFullyConnectedLayer with Optional<ConstTensor> biases
* Deprecated old AddConvolution2dLayer, AddDepthwiseConvolution2dLayer
and AddFullyConnectedLayer methods
* Made necessary changes to implementation functions
Change-Id: I65eddb28dc72a9c74429c331815a96c2bfdc8c51
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/armnn/INetwork.hpp | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index a59000b334..a4dd0da25d 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -104,29 +104,44 @@ public: /// Adds a 2D convolution layer to the network. /// @param convolution2dDescriptor - Description of the 2D convolution layer. /// @param weights - Tensor for the weights data. - /// @param biases - (Optional) 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. /// @return - Interface for configuring the layer. virtual IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor, - const ConstTensor& weights, - const char* name = nullptr) = 0; + const ConstTensor& weights, + const Optional<ConstTensor>& biases, + const char* name = nullptr) = 0; + /// @deprecated virtual IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor, - const ConstTensor& weights, - const ConstTensor& biases, - const char* name = nullptr) = 0; + const ConstTensor& weights, + const char* name = nullptr) = 0; + + /// @deprecated + virtual IConnectableLayer* AddConvolution2dLayer(const Convolution2dDescriptor& convolution2dDescriptor, + const ConstTensor& weights, + const ConstTensor& biases, + const char* name = nullptr) = 0; /// Adds a 2D depthwise convolution layer to the network. /// @param convolution2dDescriptor - Description of the 2D depthwise convolution layer. /// @param weights - Tensor for the weights. Expected format: [channelMultiplier, inputChannels, height, width]. - /// @param biases (Optional) - 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. /// @return - Interface for configuring the layer. virtual IConnectableLayer* AddDepthwiseConvolution2dLayer( const DepthwiseConvolution2dDescriptor& convolution2dDescriptor, const ConstTensor& weights, + const Optional<ConstTensor>& biases, + const char* name = nullptr) = 0; + + /// @deprecated + virtual IConnectableLayer* AddDepthwiseConvolution2dLayer( + const DepthwiseConvolution2dDescriptor& convolution2dDescriptor, + const ConstTensor& weights, const char* name = nullptr) = 0; + /// @deprecated virtual IConnectableLayer* AddDepthwiseConvolution2dLayer( const DepthwiseConvolution2dDescriptor& convolution2dDescriptor, const ConstTensor& weights, @@ -146,17 +161,24 @@ public: /// Adds a fully connected layer to the network. /// @param fullyConnectedDescriptor - Description of the fully connected layer. /// @param weights - Tensor for the weights data. - /// @param biases - (Optional) Tensor for the bias data. + /// @param biases - Optional tensor for the bias data. /// @param name - Optional name for the layer. /// @return - Interface for configuring the layer. virtual IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor, - const ConstTensor& weights, - const char* name = nullptr) = 0; + const ConstTensor& weights, + const Optional<ConstTensor>& biases, + const char* name = nullptr) = 0; + /// @deprecated virtual IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor, - const ConstTensor& weights, - const ConstTensor& biases, - const char* name = nullptr) = 0; + const ConstTensor& weights, + const char* name = nullptr) = 0; + + /// @deprecated + virtual IConnectableLayer* AddFullyConnectedLayer(const FullyConnectedDescriptor& fullyConnectedDescriptor, + const ConstTensor& weights, + const ConstTensor& biases, + const char* name = nullptr) = 0; /// Adds a permute layer to the network. /// @param permuteDescriptor - PermuteDescriptor to configure the permute. |