MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / get_quantized_activation_min_max

Function get_quantized_activation_min_max

src/core/Utils.cpp:442–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442std::pair<int32_t, int32_t> get_quantized_activation_min_max(const ActivationLayerInfo &act_info,
443 DataType data_type,
444 UniformQuantizationInfo oq_info)
445{
446 const bool is_qasymm8_signed = is_data_type_quantized_asymmetric_signed(data_type);
447 const auto a = act_info.a();
448 const auto b = act_info.b();
449 const int a_int = is_qasymm8_signed ? quantize_qasymm8_signed(a, oq_info) : quantize_qasymm8(a, oq_info);
450 const int b_int = is_qasymm8_signed ? quantize_qasymm8_signed(b, oq_info) : quantize_qasymm8(b, oq_info);
451 const auto type_max_value = std::get<1>(get_min_max(data_type)).get<int32_t>();
452
453 const int32_t min_activation = act_info.activation() != ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU
454 ? std::min(oq_info.offset, type_max_value)
455 : b_int;
456 const int32_t max_activation =
457 act_info.activation() == ActivationLayerInfo::ActivationFunction::RELU ? type_max_value : a_int;
458
459 return std::make_pair(min_activation, max_activation);
460}
461
462std::unordered_map<const ITensorInfo *, PaddingSize> get_padding_info(std::initializer_list<const ITensor *> tensors)
463{

Callers 13

configureMethod · 0.85
validateMethod · 0.85
configureMethod · 0.85
configureMethod · 0.85
configure_mmMethod · 0.85
validate_mmMethod · 0.85
create_arm_dwc_quantFunction · 0.85

Calls 7

quantize_qasymm8_signedFunction · 0.85
get_min_maxFunction · 0.85
aMethod · 0.80
bMethod · 0.80
activationMethod · 0.80
quantize_qasymm8Function · 0.50

Tested by

no test coverage detected