ONNX Runtime
|
IEEE 754 half-precision floating point data type. More...
#include <onnxruntime_cxx_api.h>
Public Types | |
using | Base = onnxruntime_float16::Float16Impl< Float16_t > |
Public Member Functions | |
Float16_t ()=default | |
Default constructor. | |
Float16_t (float v) noexcept | |
__ctor from float. Float is converted into float16 16-bit representation. | |
float | ToFloat () const noexcept |
Converts float16 to float. | |
operator float () const noexcept | |
User defined conversion operator. Converts Float16_t to float. | |
Static Public Member Functions | |
static constexpr Float16_t | FromBits (uint16_t v) noexcept |
Explicit conversion to uint16_t representation of float16. | |
IEEE 754 half-precision floating point data type.
This struct is used for converting float to float16 and back so the user could feed inputs and fetch outputs using these type.
The size of the structure should align with uint16_t and one can freely cast uint16_t buffers to/from Ort::Float16_t to feed and retrieve data.
using Ort::Float16_t::Base = onnxruntime_float16::Float16Impl<Float16_t> |
|
default |
Default constructor.
|
inlineexplicitnoexcept |
__ctor from float. Float is converted into float16 16-bit representation.
v | float value |
|
inlinestaticconstexprnoexcept |
Explicit conversion to uint16_t representation of float16.
v | uint16_t bit representation of float16 |
|
inlineexplicitnoexcept |
User defined conversion operator. Converts Float16_t to float.
|
inlinenoexcept |
Converts float16 to float.