17 using namespace armcomputetensorutils;
26 const arm_compute::TensorInfo aclInput = BuildArmComputeTensorInfo(input);
27 const arm_compute::TensorInfo aclOutput = BuildArmComputeTensorInfo(output);
28 const arm_compute::TensorInfo aclWeights = BuildArmComputeTensorInfo(weights);
30 arm_compute::TensorInfo aclBiases;
31 arm_compute::TensorInfo* optionalAclBiases =
nullptr;
35 aclBiases = BuildArmComputeTensorInfo(biases.
value());
36 optionalAclBiases = &aclBiases;
39 const arm_compute::FullyConnectedLayerInfo fullyConnectedLayerInfo =
42 return arm_compute::CLFullyConnectedLayer::validate(&aclInput,
46 fullyConnectedLayerInfo);
52 std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager,
53 const arm_compute::CLCompileContext& clCompileContext)
73 m_WeightsTensor = std::make_unique<arm_compute::CLTensor>();
78 m_BiasesTensor = std::make_unique<arm_compute::CLTensor>();
89 arm_compute::FullyConnectedLayerInfo fc_info =
94 m_FullyConnectedLayer.configure(clCompileContext,
96 m_WeightsTensor.get(),
111 m_FullyConnectedLayer.prepare();
121 void ClFullyConnectedWorkload::FreeUnusedTensors()
123 FreeTensorIfUnused(m_WeightsTensor);
124 FreeTensorIfUnused(m_BiasesTensor);
#define ARMNN_SCOPED_PROFILING_EVENT_CL_GUID(name, guid)
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
arm_compute::ActivationLayerInfo ConvertAdditionalInfoToAclActivationLayerInfo(const QueueDescriptor &queueDescriptor)
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
Copyright (c) 2021 ARM Limited and Contributors.
const ConstTensorHandle * m_Bias
LayerDescriptor m_Parameters
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
const TensorInfo & GetTensorInfo() const
std::vector< TensorInfo > m_InputTensorInfos
FullyConnectedQueueDescriptor m_Data
bool has_value() const noexcept
A FullyConnectedDescriptor for the FullyConnectedLayer.
bool m_BiasEnabled
Enable/disable bias.
void Execute() const override
arm_compute::FullyConnectedLayerInfo ConvertFullyConnectedDescriptorToAclFullyConnectedLayerInfo(const FullyConnectedDescriptor &fullyConnectedDesc, const ActivationDescriptor *activationDesc)
#define ARMNN_ASSERT(COND)
std::vector< TensorInfo > m_OutputTensorInfos
arm_compute::Status ClFullyConnectedWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const Optional< TensorInfo > &biases, const FullyConnectedDescriptor &descriptor, const ActivationDescriptor *activationDescriptor)
const ConstTensorHandle * m_Weight
An ActivationDescriptor for the ActivationLayer.
profiling::ProfilingGuid GetGuid() const final
Optional< TensorInfo > m_BiasTensorInfo
std::vector< ITensorHandle * > m_Outputs
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Contains information about TensorInfos of a layer.
ClFullyConnectedWorkload(const FullyConnectedQueueDescriptor &descriptor, const WorkloadInfo &info, std::shared_ptr< arm_compute::MemoryManagerOnDemand > &memoryManager, const arm_compute::CLCompileContext &clCompileContext)
void InitializeArmComputeClTensorData(arm_compute::CLTensor &clTensor, const ConstTensorHandle *handle)
std::vector< ITensorHandle * > m_Inputs
Optional< TensorInfo > m_WeightsTensorInfo