61 dst[i] =
static_cast<T
>(1) / (static_cast<T>(1) +
std::exp(-x));
64 dst[i] = std::max<T>(
static_cast<T
>(0), x);
70 dst[i] = std::min<T>(
a, std::max<T>(
b, x));
73 dst[i] = (x > 0) ? x : a * x;
79 dst[i] = std::sqrt(x);
98 using namespace fixed_point_arithmetic;
105 const fixed_point<T>
a(info.
a(), fixed_point_position);
106 const fixed_point<T>
b(info.
b(), fixed_point_position);
107 const fixed_point<T> const_0(0, fixed_point_position);
108 const fixed_point<T> const_1(1, fixed_point_position);
112 fixed_point<T> x(src[i], fixed_point_position,
true);
123 dst[i] = (const_1 / (const_1 +
exp(-x))).raw();
126 dst[i] =
max(const_0, x).raw();
135 dst[i] = (x > const_0) ? x.raw() :
mul(
a, x).raw();
fixed_point< T > mul(fixed_point< T > x, fixed_point< T > y)
fixed_point< T > min(fixed_point< T > x, fixed_point< T > y)
SimpleTensor< T > activation_layer(const SimpleTensor< T > &src, ActivationLayerInfo info)
fixed_point< T > exp(fixed_point< T > x)
#define ARM_COMPUTE_ERROR(...)
Print the given message then throw an std::runtime_error.
DataType data_type() const override
Data type of the tensor.
ActivationFunction activation() const
TensorShape shape() const override
Shape of the tensor.
Activation Layer Information class.
src info() -> set_format(Format::S16)
This file contains all available output stages for GEMMLowp on OpenCL.
fixed_point< T > log(fixed_point< T > x)
fixed_point< T > add(fixed_point< T > x, fixed_point< T > y)
SimpleTensor< uint8_t > convert_to_asymmetric(const SimpleTensor< float > &src, const QuantizationInfo &quantization_info)
Convert float simple tensor into quantized using specified quantization information.
fixed_point< T > inv_sqrt(fixed_point< T > x)
SimpleTensor< uint8_t > activation_layer< uint8_t >(const SimpleTensor< uint8_t > &src, ActivationLayerInfo info)
Lower and Upper Bounded Rectifier ( )
Simple tensor object that stores elements in a consecutive chunk of memory.
Upper Bounded Rectifier ( )
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
Convert quantized simple tensor into float using tensor quantization information. ...
int num_elements() const override
Number of elements of the tensor.
fixed_point< T > max(fixed_point< T > x, fixed_point< T > y)
fixed_point< T > tanh(fixed_point< T > x)
fixed_point< T > abs(fixed_point< T > x)
QuantizationInfo quantization_info() const override
Quantization info in case of asymmetric quantized type.
int fixed_point_position() const override
The number of bits for the fractional part of the fixed point numbers.
convolution configure & src