From 195b0ba457d0020e1f54fb0c0378040e1c75d510 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 2 Aug 2018 17:18:51 +0100 Subject: MLCE-36: FC tranpose weights Change-Id: I3b8a6c00e61ba6da459ca5fc7275393f9d073aed Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/142533 Reviewed-by: Anthony Barbier Tested-by: Jenkins --- src/graph/nodes/FullyConnectedLayer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/graph/nodes/FullyConnectedLayer.cpp') diff --git a/src/graph/nodes/FullyConnectedLayer.cpp b/src/graph/nodes/FullyConnectedLayer.cpp index f41e1a3c22..6ea0292505 100644 --- a/src/graph/nodes/FullyConnectedLayer.cpp +++ b/src/graph/nodes/FullyConnectedLayer.cpp @@ -40,6 +40,7 @@ FullyConnectedLayerNode::FullyConnectedLayerNode(unsigned int num_outputs, Quant TensorDescriptor FullyConnectedLayerNode::compute_weights_descriptor(const TensorDescriptor &input_descriptor, unsigned int num_outputs, + FullyConnectedLayerInfo fc_info, QuantizationInfo weights_quant_info) { unsigned int num_weights = 1; @@ -57,6 +58,12 @@ TensorDescriptor FullyConnectedLayerNode::compute_weights_descriptor(const Tenso TensorDescriptor weights_descriptor = input_descriptor; weights_descriptor.shape = TensorShape(num_weights, num_outputs); + // If weights are tranposed, use tranposed shape + if(!fc_info.transpose_weights) + { + weights_descriptor.shape = TensorShape(num_outputs, num_weights); + } + // Set quantization info if present if(!weights_quant_info.empty()) { -- cgit v1.2.1