COMPMID-3069: Validate bias dimensionality in NEFullyConnectedLayer
authorGeorgios Pinitas <georgios.pinitas@arm.com>
Wed, 29 Apr 2020 12:37:09 +0000 (13:37 +0100)
committerMichele Di Giorgio <michele.digiorgio@arm.com>
Fri, 1 May 2020 08:52:33 +0000 (08:52 +0000)
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Ib5add7951417806f89ce9445f8cdd723488193c3
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3119
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>

src/runtime/NEON/functions/NEFullyConnectedLayer.cpp

index 6e398ac1d1a9fbcaf5fbdd222a2466e8be156974..e275bca2f9cef6978a67ab6724fbfbbe9a4c4b2b 100644 (file)
@@ -318,6 +318,7 @@ Status NEFullyConnectedLayer::validate(const ITensorInfo *input, const ITensorIn
     ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED, DataType::F16, DataType::F32);
     ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, weights, output);
     ARM_COMPUTE_RETURN_ERROR_ON(weights->num_dimensions() > 2);
+    ARM_COMPUTE_RETURN_ERROR_ON(biases != nullptr && biases->num_dimensions() > 1);
 
     bool weights_reshaped = fc_info.transpose_weights ? fc_info.are_weights_reshaped : true;
     bool is_fc_after_conv = true;
@@ -484,4 +485,4 @@ void NEFullyConnectedLayer::prepare()
         _is_prepared = true;
     }
 }
-} // namespace arm_compute
\ No newline at end of file
+} // namespace arm_compute