aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures/SoftmaxLayerFixture.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/fixtures/SoftmaxLayerFixture.h')
-rw-r--r--tests/validation/fixtures/SoftmaxLayerFixture.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/tests/validation/fixtures/SoftmaxLayerFixture.h b/tests/validation/fixtures/SoftmaxLayerFixture.h
index c2ab2e2ef6..59ce5192ff 100644
--- a/tests/validation/fixtures/SoftmaxLayerFixture.h
+++ b/tests/validation/fixtures/SoftmaxLayerFixture.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -47,13 +47,12 @@ class SoftmaxValidationGenericFixture : public framework::Fixture
{
public:
template <typename...>
- void setup(TensorShape shape, DataType data_type, int fractional_bits, QuantizationInfo quantization_info, float beta)
+ void setup(TensorShape shape, DataType data_type, QuantizationInfo quantization_info, float beta)
{
- _fractional_bits = fractional_bits;
_quantization_info = quantization_info;
- _target = compute_target(shape, data_type, fractional_bits, quantization_info, beta);
- _reference = compute_reference(shape, data_type, fractional_bits, quantization_info, beta);
+ _target = compute_target(shape, data_type, quantization_info, beta);
+ _reference = compute_reference(shape, data_type, quantization_info, beta);
}
protected:
@@ -72,18 +71,18 @@ protected:
}
else
{
- const int one_fixed = 1 << _fractional_bits;
+ const int one_fixed = 1;
std::uniform_int_distribution<> distribution(-one_fixed, one_fixed);
library->fill(tensor, distribution, 0);
}
}
- TensorType compute_target(const TensorShape &shape, DataType data_type, int fixed_point_position,
+ TensorType compute_target(const TensorShape &shape, DataType data_type,
QuantizationInfo quantization_info, float beta)
{
// Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type, 1, fixed_point_position, quantization_info);
- TensorType dst = create_tensor<TensorType>(shape, data_type, 1, fixed_point_position, QuantizationInfo(1.f / 256, 0));
+ TensorType src = create_tensor<TensorType>(shape, data_type, 1, quantization_info);
+ TensorType dst = create_tensor<TensorType>(shape, data_type, 1, QuantizationInfo(1.f / 256, 0));
// Create and configure function
FunctionType smx_layer;
@@ -108,11 +107,11 @@ protected:
return dst;
}
- SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type, int fixed_point_position,
+ SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type,
QuantizationInfo quantization_info, float beta)
{
// Create reference
- SimpleTensor<T> src{ shape, data_type, 1, fixed_point_position, quantization_info };
+ SimpleTensor<T> src{ shape, data_type, 1, quantization_info };
// Fill reference
fill(src);
@@ -122,7 +121,6 @@ protected:
TensorType _target{};
SimpleTensor<T> _reference{};
- int _fractional_bits{};
QuantizationInfo _quantization_info{};
};
@@ -135,7 +133,6 @@ public:
{
SoftmaxValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape,
data_type,
- 0,
QuantizationInfo(),
beta);
}
@@ -146,11 +143,10 @@ class SoftmaxValidationFixedPointFixture : public SoftmaxValidationGenericFixtur
{
public:
template <typename...>
- void setup(TensorShape shape, DataType data_type, int fixed_point_position)
+ void setup(TensorShape shape, DataType data_type)
{
SoftmaxValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape,
data_type,
- fixed_point_position,
QuantizationInfo(),
1.0f);
}
@@ -165,7 +161,6 @@ public:
{
SoftmaxValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape,
data_type,
- 0,
quantization_info,
beta);
}