This class holds precision value and provides precision related operations.
More...
#include <ie_precision.hpp>
|
enum | ePrecision : uint8_t {
UNSPECIFIED = 255,
MIXED = 0,
FP32 = 10,
FP16 = 11,
BF16 = 12,
Q78 = 20,
I16 = 30,
U8 = 40,
I8 = 50,
U16 = 60,
I32 = 70,
I64 = 72,
U64 = 73,
BIN = 71,
BOOL = 41,
CUSTOM = 80
} |
|
|
template<class T > |
static Precision | fromType (const char *typeName=nullptr) |
| Creates custom precision with specific underlined type.
|
|
static Precision | FromStr (const std::string &str) |
| Creates from string with precision name.
|
|
This class holds precision value and provides precision related operations.
§ ePrecision
Enum to specify of different
Enumerator |
---|
UNSPECIFIED | Unspecified value. Used by default
|
MIXED | Mixed value. Can be received from network. No applicable for tensors
|
FP32 | 32bit floating point value
|
FP16 | 16bit floating point value, 5 bit for exponent, 10 bit for mantisa
|
BF16 | 16bit floating point value, 8 bit for exponent, 7 bit for mantisa
|
Q78 | 16bit specific signed fixed point precision
|
I16 | 16bit signed integer value
|
U8 | 8bit unsigned integer value
|
I8 | 8bit signed integer value
|
U16 | 16bit unsigned integer value
|
I32 | 32bit signed integer value
|
I64 | 64bit signed integer value
|
U64 | 64bit unsigned integer value
|
BIN | 1bit integer value
|
BOOL | 8bit bool type
|
CUSTOM | custom precision has it's own name and size of elements
|
§ Precision()
InferenceEngine::Precision::Precision |
( |
size_t |
bitsSize, |
|
|
const char * |
name = nullptr |
|
) |
| |
|
inlineexplicit |
Custom precision constructor.
- Parameters
-
bitsSize | size of elements |
name | optional name string, used in serialisation |
§ areSameStrings()
static bool InferenceEngine::Precision::areSameStrings |
( |
const char * |
l, |
|
|
const char * |
r |
|
) |
| |
|
inlinestaticprotectednoexcept |
Compare two c-strings.
- Parameters
-
l | Const pointer to first string |
r | Const pointer to another string |
- Returns
- True if strings are the same
§ getPrecVal()
constexpr uint8_t InferenceEngine::Precision::getPrecVal |
( |
| ) |
const |
|
inlinenoexcept |
Gets the precision value of type ePrecision.
- Returns
- The preccision value.
§ is_float()
bool InferenceEngine::Precision::is_float |
( |
| ) |
const |
|
inlinenoexcept |
Checks if it is a floating point value.
- Returns
- True if precision is float point,
false
otherwise
§ isSigned()
bool InferenceEngine::Precision::isSigned |
( |
| ) |
const |
|
inlinenoexcept |
Checks if it is a signed value.
- Returns
- True if precision is signed,
false
otherwise
§ makePrecisionInfo()
template<Precision::ePrecision precision>
static PrecisionInfo InferenceEngine::Precision::makePrecisionInfo |
( |
const char * |
name | ) |
|
|
staticprotected |
Creates PrecisionInfo by precision
with a specified name.
- Template Parameters
-
precision | A precision to create PrecisionInfo for |
- Parameters
-
- Returns
- A PrecisionInfo object
§ size()
size_t InferenceEngine::Precision::size |
( |
| ) |
const |
|
inline |
Returns size of single element of that precision in bits.
- Returns
- Number of bytes per element
The documentation for this class was generated from the following file: