diff options
author | Cathal Corbett <cathal.corbett@arm.com> | 2022-05-13 09:55:59 +0100 |
---|---|---|
committer | Cathal Corbett <cathal.corbett@arm.com> | 2022-05-13 15:09:18 +0000 |
commit | 4452baf3d295164877c5810a3867b1d2d79b04f3 (patch) | |
tree | 861b248dd0a603140eb384e48cd9ef97603a296b /src/backends/cl/ClBackend.cpp | |
parent | c46b90ef031a8041fe25a7191de799eca9eff8e5 (diff) | |
download | armnn-4452baf3d295164877c5810a3867b1d2d79b04f3.tar.gz |
IVGCVSW-6260 ConstTensorsAsInput: Fully Connected Cl and Neon support.
* IVGCVSW-6940 ConstTensorsAsInput: DepthwiseConvolution2d - Complete Neon and Cl Bug Fix
* Bug fix to enable Cl and Neon Backend Compatibility ConstantTensorsAsInputs
* Updated Cl and Neon FullyConnected workloads to handle constant
weights and bias as inputs rather than reading from member variables.
* Prevent non const weights and biases passing CL and NEON validate
for Depthwise Convolution.
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com>
Change-Id: I0f505ff5998a183152f843d0f6cc74327ba920e7
Diffstat (limited to 'src/backends/cl/ClBackend.cpp')
-rw-r--r-- | src/backends/cl/ClBackend.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backends/cl/ClBackend.cpp b/src/backends/cl/ClBackend.cpp index ed6f221511..47990d87dc 100644 --- a/src/backends/cl/ClBackend.cpp +++ b/src/backends/cl/ClBackend.cpp @@ -398,18 +398,19 @@ OptimizationViews ClBackend::OptimizeSubgraphView(const SubgraphView& subgraph, else if (base.GetType() == LayerType::FullyConnected) { FullyConnectedLayer* baseLayer = PolymorphicDowncast<FullyConnectedLayer*>(&base); + FullyConnectedDescriptor descriptor = baseLayer->GetParameters(); + // As bias is optional only try to get TensorInfo from input if bias is enabled. Optional<TensorInfo> biases; - - if (baseLayer->GetParameters().m_BiasEnabled) + if (descriptor.m_BiasEnabled) { - biases = baseLayer->m_Bias->GetTensorInfo(); + biases = baseLayer->GetInputSlot(2).GetConnectedOutputSlot()->GetTensorInfo(); } arm_compute::Status status = ClFullyConnectedWorkloadValidate( baseLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(), activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(), - baseLayer->m_Weight->GetTensorInfo(), + baseLayer->GetInputSlot(1).GetConnectedOutputSlot()->GetTensorInfo(), biases, baseLayer->GetParameters(), &activationDesc); |