33 #include "utils/Utils.h" 79 width->set_help(
"Set Input dimension width");
80 batch->set_help(
"Set Input dimension batch");
81 input_scale->set_help(
"Quantization scale from QASYMM8");
82 input_offset->set_help(
"Quantization offset from QASYMM8");
83 weights_scale->set_help(
"Quantization scale from QASYMM8");
84 weights_offset->set_help(
"Quantization offset from QASYMM8");
85 output_scale->set_help(
"Quantization scale from QASYMM8");
86 output_offset->set_help(
"Quantization offset from QASYMM8");
87 num_outputs->set_help(
"Number of outputs.");
88 input_range_low->set_help(
"Lower bound for input randomization range");
89 input_range_high->set_help(
"Lower bound for input randomization range");
90 weights_range_low->set_help(
"Lower bound for input randomization range");
91 weights_range_high->set_help(
"Lower bound for input randomization range");
119 void print_parameters(::std::ostream &os,
const ExampleParams &common_params)
override 123 os <<
"Data type : " << common_params.
data_type << std::endl;
124 os <<
"Input dimensions(X,Y, Channels, Batch) : (" << common_params.
input.
width <<
"," << common_params.
input.
height <<
"," << common_params.
input.
fm <<
"," << common_params.
input.
batch <<
")" 130 FullyConnectedOptions(
const FullyConnectedOptions &) =
delete;
132 FullyConnectedOptions &operator=(
const FullyConnectedOptions &) =
delete;
134 FullyConnectedOptions(FullyConnectedOptions &&) noexcept(true) =
default;
136 FullyConnectedOptions &operator=(FullyConnectedOptions &&) noexcept(true) = default;
138 ~FullyConnectedOptions() override = default;
157 template <typename D>
158 class FullyConnectedVerifyAccessor final : public
VerifyAccessor<D>
161 using BaseClassType::BaseClassType;
162 using BaseClassType::_params;
174 const TensorDescriptor weights_descriptor = FullyConnectedLayerNode::compute_weights_descriptor(input_descriptor,
175 _params.fully_connected.num_outputs,
176 _params.fully_connected.info,
178 const TensorDescriptor output_desciptor = FullyConnectedLayerNode::compute_output_descriptor(input_descriptor, _params.fully_connected.num_outputs, _params.output.
quant_info);
190 const TensorShape input_shape =
TensorShape(_params.input.width, _params.input.height, _params.input.fm, _params.input.batch);
192 const TensorDescriptor output_desciptor = FullyConnectedLayerNode::compute_output_descriptor(input_descriptor, _params.fully_connected.num_outputs, _params.output.
quant_info);
194 return output_desciptor.
shape;
202 return reference::fully_connected_layer<D>(
src, weights,
bias,
output_shape, _params.output.quant_info);
205 float relative_tolerance()
override 207 const std::map<arm_compute::graph::Target, const std::map<DataType, float>> relative_tolerance
225 return relative_tolerance.at(_params.common_params.target).at(_params.data_type);
228 float absolute_tolerance()
override 230 const std::map<Target, const std::map<DataType, float>> absolute_tolerance
248 return absolute_tolerance.at(_params.common_params.target).at(_params.data_type);
251 float tolerance_number()
override 253 const std::map<Target, const std::map<DataType, float>> absolute_tolerance
271 return absolute_tolerance.at(_params.common_params.target).at(_params.data_type);
277 class GraphFullyConnectedValidateExample final :
public GraphValidateExample<FullyConnectedLayer, FullyConnectedOptions, FullyConnectedVerifyAccessor>
282 GraphFullyConnectedValidateExample()
310 int main(
int argc,
char **argv)
312 return arm_compute::utils::run_example<GraphFullyConnectedValidateExample>(argc, argv);
TensorShape shape
Tensor shape.
Arm® Neon™ capable target device.
Class describing the value of a pixel for any image format.
1 channel, 1 F32 per channel
CommonGraphValidateOptions command line options used to configure the graph examples.
Includes all the Graph headers at once.
Class to parse command line arguments.
decltype(strategy::transforms) typedef type
Interface for CPU tensor.
SimpleTensor< float > src
Copyright (c) 2017-2022 Arm Limited.
arm_compute::graph::Target target
std::unique_ptr< graph::ITensorAccessor > get_random_accessor(PixelValue lower, PixelValue upper, const std::random_device::result_type seed=0)
Generates appropriate random accessor.
1 channel, 1 F16 per channel
T x() const
Alias to access the size of the first dimension.
Quantization information.
QuantizationInfo quant_info
Quantization info.
const auto input_shape
Validate test suite is to test ARM_COMPUTE_RETURN_ON_* macros we use to check the validity of given a...
arm_compute::DataType data_type
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
quantized, asymmetric fixed-point 8-bit number unsigned
Structure holding all the graph Example parameters.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
FullyConnectedLayerInfo info
Simple tensor object that stores elements in a consecutive chunk of memory.
FullyConnectedParams fully_connected
Graph example validation accessor class.
FrameworkParams common_params
arm_compute::graph::frontend::Stream graph
OpenCL capable target device.
int main(int argc, char **argv)
Main program for Graph fully_connected test.
QuantizationInfo quant_info