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

Function get_softmax_output_quantization_info

src/core/Utils.cpp:421–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421QuantizationInfo get_softmax_output_quantization_info(DataType input_type, bool is_log)
422{
423 // Note: Output quantization info for softmax should always have
424 // * Softmax with QASYMM8: scale = 1/256, offset = 0
425 // * Softmax with QASYMM8_SIGNED: scale = 1/256, offset = -128
426 // * LogSoftmax with QASYMM8: scale = 16/256, offset = 255
427 // * LogSoftmax with QASYMM8_SIGNED: scale = 16/256, offset = 127
428 if (is_data_type_quantized_asymmetric_signed(input_type))
429 {
430 if (is_log)
431 {
432 return QuantizationInfo(16.f / 256, 127);
433 }
434 else
435 {
436 return QuantizationInfo(1.f / 256, -128);
437 }
438 }
439 return is_log ? QuantizationInfo(16.f / 256, 255) : QuantizationInfo(1.f / 256, 0);
440}
441
442std::pair<int32_t, int32_t> get_quantized_activation_min_max(const ActivationLayerInfo &act_info,
443 DataType data_type,

Callers 7

validateMethod · 0.85
configureMethod · 0.85
configure_outputMethod · 0.85
softmax_layerFunction · 0.85
compute_targetMethod · 0.85
compute_targetMethod · 0.85

Tested by

no test coverage detected