namespace InferenceEngine::PrecisionUtils¶
Overview¶
Namespace for precision utilities. More…
namespace PrecisionUtils {
// namespaces
namespace InferenceEngine::PrecisionUtils::details;
// global functions
ie_fp16float f32tof16();
floatie_fp16 f16tof32();
voidfloat \*const ie_fp16 \*size_tfloatfloat f16tof32Arrays(, , , , );
voidie_fp16 \*const float \*size_tfloatfloat f32tof16Arrays(, , , , );
template <, , >
OutTconst InT& saturate_cast();
template <>
InTconst InT& saturate_cast();
} // namespace PrecisionUtils
Detailed Documentation¶
Namespace for precision utilities.
Global Functions¶
ie_fp16float f32tof16()
Converts a single-precision floating point value to a half-precision floating poit value.
Parameters:
x |
A single-precision floating point value |
Returns:
A half-precision floating point value
floatie_fp16 f16tof32()
Convers a half-precision floating point value to a single-precision floating point value.
Parameters:
x |
A half-precision floating point value |
Returns:
A single-precision floating point value
voidfloat \*const ie_fp16 \*size_tfloatfloat f16tof32Arrays(, , , , )
Converts a half-precision floating point array to single-precision floating point array and applies scale
and bias
is needed.
Parameters:
dst |
A destination array of single-precision floating point values |
src |
A source array of half-precision floating point values |
nelem |
A number of elements in arrays |
scale |
An optional scale parameter |
bias |
An optional bias parameter |
voidie_fp16 \*const float \*size_tfloatfloat f32tof16Arrays(, , , , )
Converts a single-precision floating point array to a half-precision floating point array and applies scale
and bias
if needed.
Parameters:
dst |
A destination array of half-precision floating point values |
src |
A sources array of single-precision floating point values |
nelem |
A number of elements in arrays |
scale |
An optional scale parameter |
bias |
An optional bias parameter |
template <, , >
OutTconst InT& saturate_cast()
Converts one integral type to another saturating the result if the source value doesn’t fit into destination type range.
Parameters:
value |
Value to be converted |
Returns:
A saturated value
template <>
InTconst InT& saturate_cast()
Converts one integral type to another saturating the result if the source value doesn’t fit into destination type range.
Parameters:
value |
Value to be converted |
Returns:
A saturated value