HDK
|
IEEE 754 half-precision floating point data type. More...
#include <onnxruntime_cxx_api.h>
Public Member Functions | |
constexpr | Float16_t () noexcept |
constexpr | Float16_t (uint16_t v) noexcept |
constexpr | operator uint16_t () const noexcept |
constexpr bool | operator== (const Float16_t &rhs) const noexcept |
constexpr bool | operator!= (const Float16_t &rhs) const noexcept |
Public Attributes | |
uint16_t | value |
IEEE 754 half-precision floating point data type.
It is necessary for type dispatching to make use of C++ API The type is implicitly convertible to/from uint16_t. 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.
Generally, you can feed any of your types as float16/blfoat16 data to create a tensor on top of it, providing it can form a continuous buffer with 16-bit elements with no padding. And you can also feed a array of uint16_t elements directly. For example,
Here is another example, a little bit more elaborate. Let's assume that you use your own float16 type and you want to use a templated version of the API above so the type is automatically set based on your type. You will need to supply an extra template specialization.
Definition at line 169 of file onnxruntime_cxx_api.h.
|
inlinenoexcept |
Definition at line 171 of file onnxruntime_cxx_api.h.
|
inlinenoexcept |
Definition at line 172 of file onnxruntime_cxx_api.h.
|
inlinenoexcept |
Definition at line 173 of file onnxruntime_cxx_api.h.
|
inlinenoexcept |
Definition at line 175 of file onnxruntime_cxx_api.h.
Definition at line 174 of file onnxruntime_cxx_api.h.
uint16_t Ort::Float16_t::value |
Definition at line 170 of file onnxruntime_cxx_api.h.