23.11
|
Graph example validation accessor class. More...
#include <graph_validate_utils.h>
Public Types | |
using | TBias = typename std::conditional< std::is_same< typename std::decay< D >::type, uint8_t >::value, int32_t, D >::type |
Public Member Functions | |
VerifyAccessor (ExampleParams ¶ms) | |
Constructor. More... | |
bool | access_tensor (ITensor &tensor) override |
Interface to be implemented to access a given tensor. More... | |
virtual void | create_tensors (arm_compute::test::SimpleTensor< D > &src, arm_compute::test::SimpleTensor< D > &weights, arm_compute::test::SimpleTensor< TBias > &bias, ITensor &tensor) |
Create reference tensors. More... | |
virtual TensorShape | output_shape (ITensor &tensor) |
Calculate reference output tensor shape. More... | |
virtual arm_compute::test::SimpleTensor< D > | reference (arm_compute::test::SimpleTensor< D > &src, arm_compute::test::SimpleTensor< D > &weights, arm_compute::test::SimpleTensor< TBias > &bias, const arm_compute::TensorShape &output_shape)=0 |
Calculate reference tensor. More... | |
void | fill_tensor (arm_compute::test::SimpleTensor< uint8_t > &tensor, std::random_device::result_type seed, uint8_t low, uint8_t high) |
Fill QASYMM tensor with Random values. More... | |
void | fill_tensor (arm_compute::test::SimpleTensor< int32_t > &tensor, std::random_device::result_type seed, int32_t low, int32_t high) |
Fill S32 tensor with Random values. More... | |
void | fill_tensor (arm_compute::test::SimpleTensor< float > &tensor, std::random_device::result_type seed, float low, float high) |
Fill F32 tensor with Random values. More... | |
void | fill_tensor (arm_compute::test::SimpleTensor< half > &tensor, std::random_device::result_type seed, half low, half high) |
Fill F16 tensor with Random values. More... | |
virtual float | relative_tolerance ()=0 |
Select relative tolerance. More... | |
virtual float | absolute_tolerance ()=0 |
Select absolute tolerance. More... | |
virtual float | tolerance_number ()=0 |
Select tolerance number. More... | |
void | validate (ITensor &tensor, arm_compute::test::SimpleTensor< D > output) |
Validate the output versus the reference. More... | |
![]() | |
virtual | ~ITensorAccessor ()=default |
Default virtual destructor. More... | |
virtual bool | access_tensor_data () |
Returns true if the tensor data is being accessed. More... | |
Data Fields | |
ExampleParams | _params |
Graph example validation accessor class.
Definition at line 346 of file graph_validate_utils.h.
using TBias = typename std::conditional<std::is_same<typename std::decay<D>::type, uint8_t>::value, int32_t, D>::type |
Definition at line 349 of file graph_validate_utils.h.
|
inlineexplicit |
Constructor.
[in] | params | Convolution parameters |
Definition at line 354 of file graph_validate_utils.h.
|
pure virtual |
Select absolute tolerance.
Select absolute tolerance if not supplied by user.
Referenced by VerifyAccessor< D >::validate().
|
inlineoverridevirtual |
Interface to be implemented to access a given tensor.
[in] | tensor | Tensor to be accessed |
Implements ITensorAccessor.
Definition at line 359 of file graph_validate_utils.h.
References VerifyAccessor< D >::_params, NumPyAccessor::access_tensor(), bias, VerifyAccessor< D >::create_tensors(), VerifyAccessor< D >::fill_tensor(), CommonParams::input, TensorParams::npy, CommonParams::output, VerifyAccessor< D >::output_shape(), TensorParams::range_high, TensorParams::range_low, VerifyAccessor< D >::reference(), arm_compute::test::validation::src, tensor, VerifyAccessor< D >::validate(), and CommonParams::weights.
|
inlinevirtual |
Create reference tensors.
Validate the given tensor against the reference result.
[out] | src | The tensor with the source data. |
[out] | weights | The tensor with the weigths data. |
[out] | bias | The tensor with the bias data. |
[in] | tensor | Tensor result of the actual operation passed into the Accessor. |
Definition at line 397 of file graph_validate_utils.h.
References VerifyAccessor< D >::_params, ARM_COMPUTE_UNUSED, TensorParams::batch, bias, CommonParams::data_type, TensorParams::fm, TensorParams::height, CommonParams::input, TensorParams::quant_info, arm_compute::test::validation::src, tensor, CommonParams::weights, and TensorParams::width.
Referenced by VerifyAccessor< D >::access_tensor().
|
inline |
Fill F32 tensor with Random values.
Validate the given tensor against the reference result.
[out] | tensor | The tensor we want to file |
[in] | seed | seed for the randomization function |
[in] | low | lower bound for random values |
[in] | high | upper bound for random values |
Definition at line 490 of file graph_validate_utils.h.
References ARM_COMPUTE_ERROR_ON, arm_compute::test::validation::distribution(), arm_compute::F32, and tensor.
|
inline |
Fill F16 tensor with Random values.
Validate the given tensor against the reference result.
[out] | tensor | The tensor we want to file |
[in] | seed | seed for the randomization function |
[in] | low | lower bound for random values |
[in] | high | upper bound for random values |
Definition at line 510 of file graph_validate_utils.h.
References ARM_COMPUTE_ERROR_ON, arm_compute::test::validation::distribution(), arm_compute::F16, and tensor.
|
inline |
Fill S32 tensor with Random values.
Validate the given tensor against the reference result.
[out] | tensor | The tensor we want to file |
[in] | seed | seed for the randomization function |
[in] | low | lower bound for random values |
[in] | high | upper bound for random values |
Definition at line 471 of file graph_validate_utils.h.
References arm_compute::test::validation::distribution(), and tensor.
|
inline |
Fill QASYMM tensor with Random values.
Validate the given tensor against the reference result.
[out] | tensor | The tensor we want to file |
[in] | seed | seed for the randomization function |
[in] | low | lower bound for random values |
[in] | high | upper bound for random values |
Definition at line 445 of file graph_validate_utils.h.
References ARM_COMPUTE_ERROR_ON, arm_compute::test::validation::distribution(), arm_compute::QASYMM8, arm_compute::test::validation::qinfo, arm_compute::quantize_qasymm8(), and tensor.
Referenced by VerifyAccessor< D >::access_tensor().
|
inlinevirtual |
Calculate reference output tensor shape.
[in] | tensor | Tensor result of the actual operation passed into the Accessor. |
Definition at line 415 of file graph_validate_utils.h.
References VerifyAccessor< D >::_params, ExampleParams::data_layout, arm_compute::NCHW, arm_compute::graph_utils::permute_shape(), and tensor.
Referenced by VerifyAccessor< D >::access_tensor().
|
pure virtual |
Calculate reference tensor.
Validate the given tensor against the reference result.
[in] | src | The tensor with the source data. |
[in] | weights | The tensor with the weigths data. |
[in] | bias | The tensor with the bias data. |
[in] | output_shape | Shape of the output tensor. |
Referenced by VerifyAccessor< D >::access_tensor().
|
pure virtual |
Select relative tolerance.
Select relative tolerance if not supplied by user.
Referenced by VerifyAccessor< D >::validate().
|
pure virtual |
Select tolerance number.
Select tolerance number if not supplied by user.
Referenced by VerifyAccessor< D >::validate().
|
inline |
Validate the output versus the reference.
[in] | tensor | Tensor result of the actual operation passed into the Accessor. |
[in] | output | Tensor result of the reference implementation. |
< Relative tolerance
< Absolute tolerance
< Tolerance number
Definition at line 551 of file graph_validate_utils.h.
References VerifyAccessor< D >::_params, VerificationParams::absolute_tolerance, VerifyAccessor< D >::absolute_tolerance(), VerificationParams::relative_tolerance, VerifyAccessor< D >::relative_tolerance(), tensor, arm_compute::test::validation::tolerance_num, VerificationParams::tolerance_number, VerifyAccessor< D >::tolerance_number(), arm_compute::test::validation::validate(), and CommonParams::verification.
Referenced by VerifyAccessor< D >::access_tensor().
ExampleParams _params |
Definition at line 579 of file graph_validate_utils.h.
Referenced by VerifyAccessor< D >::access_tensor(), VerifyAccessor< D >::create_tensors(), VerifyAccessor< D >::output_shape(), and VerifyAccessor< D >::validate().