ONNX Runtime
|
bfloat16 (Brain Floating Point) data type More...
#include <onnxruntime_cxx_api.h>
Public Types | |
using | Base = onnxruntime_float16::BFloat16Impl< BFloat16_t > |
Public Member Functions | |
BFloat16_t ()=default | |
BFloat16_t (float v) noexcept | |
__ctor from float. Float is converted into bfloat16 16-bit representation. | |
float | ToFloat () const noexcept |
Converts bfloat16 to float. | |
operator float () const noexcept | |
User defined conversion operator. Converts BFloat16_t to float. | |
bool | operator== (const BFloat16_t &rhs) const noexcept |
bool | operator!= (const BFloat16_t &rhs) const noexcept |
bool | operator< (const BFloat16_t &rhs) const noexcept |
Static Public Member Functions | |
static constexpr BFloat16_t | FromBits (uint16_t v) noexcept |
Explicit conversion to uint16_t representation of bfloat16. | |
bfloat16 (Brain Floating Point) data type
This struct is used for converting float to bfloat16 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::BFloat16_t to feed and retrieve data.
using Ort::BFloat16_t::Base = onnxruntime_float16::BFloat16Impl<BFloat16_t> |
|
default |
|
inlineexplicitnoexcept |
__ctor from float. Float is converted into bfloat16 16-bit representation.
v | float value |
|
inlinestaticconstexprnoexcept |
Explicit conversion to uint16_t representation of bfloat16.
v | uint16_t bit representation of bfloat16 |
|
inlineexplicitnoexcept |
User defined conversion operator. Converts BFloat16_t to float.
|
inlinenoexcept |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
Converts bfloat16 to float.