23.02
|
Go to the documentation of this file.
17 using namespace armcomputetensorutils;
26 const arm_compute::TensorInfo aclInput = BuildArmComputeTensorInfo(input);
27 const arm_compute::TensorInfo aclOutput = BuildArmComputeTensorInfo(output);
28 arm_compute::TensorInfo aclWeights = BuildArmComputeTensorInfo(weights);
29 aclWeights.set_are_values_constant(weights.
IsConstant());
31 arm_compute::TensorInfo aclBiases;
32 arm_compute::TensorInfo* optionalAclBiases =
nullptr;
37 if (!biases.
value().IsConstant())
40 "Arm NN ClFullyConnectedWorkload does not support non constant bias."};
42 aclBiases = BuildArmComputeTensorInfo(biases.
value());
43 aclBiases.set_are_values_constant(biases.
value().IsConstant());
44 optionalAclBiases = &aclBiases;
47 const arm_compute::FullyConnectedLayerInfo fullyConnectedLayerInfo =
49 return arm_compute::CLFullyConnectedLayer::validate(&aclInput,
53 fullyConnectedLayerInfo);
59 std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager,
60 const arm_compute::CLCompileContext& clCompileContext)
87 arm_compute::ICLTensor* bias =
nullptr;
90 bias = &PolymorphicDowncast<IClTensorHandle*>(
m_Data.
m_Inputs[2])->GetTensor();
95 arm_compute::FullyConnectedLayerInfo fc_info =
101 m_FullyConnectedLayer.configure(clCompileContext,
Optional< TensorInfo > m_BiasTensorInfo
virtual arm_compute::ICLTensor & GetTensor()=0
bool m_BiasEnabled
Enable/disable bias.
arm::pipe::ProfilingGuid GetGuid() const final
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
An ActivationDescriptor for the ActivationLayer.
A FullyConnectedDescriptor for the FullyConnectedLayer.
void Execute() const override
FullyConnectedQueueDescriptor m_Data
Optional< TensorInfo > m_WeightsTensorInfo
Copyright (c) 2021 ARM Limited and Contributors.
arm_compute::FullyConnectedLayerInfo ConvertFullyConnectedDescriptorToAclFullyConnectedLayerInfo(const FullyConnectedDescriptor &fullyConnectedDesc, const ActivationDescriptor *activationDesc)
arm_compute::Status ClFullyConnectedWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const Optional< TensorInfo > &biases, const FullyConnectedDescriptor &descriptor, const ActivationDescriptor *activationDescriptor)
std::vector< TensorInfo > m_OutputTensorInfos
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
bool has_value() const noexcept
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
arm_compute::ActivationLayerInfo ConvertAdditionalInfoToAclActivationLayerInfo(const QueueDescriptor &queueDescriptor)
Contains information about TensorInfos of a layer.
LayerDescriptor m_Parameters
#define ARMNN_ASSERT(COND)
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
std::vector< ITensorHandle * > m_Outputs
ClFullyConnectedWorkload(const FullyConnectedQueueDescriptor &descriptor, const WorkloadInfo &info, std::shared_ptr< arm_compute::MemoryManagerOnDemand > &memoryManager, const arm_compute::CLCompileContext &clCompileContext)
#define ARMNN_SCOPED_PROFILING_EVENT_CL_GUID(name, guid)
std::vector< TensorInfo > m_InputTensorInfos
uint32_t GetNumInputs() const
Get the number of inputs.
std::vector< ITensorHandle * > m_Inputs