Runtime primitive data type.
More...
#include <data_type.h>
Runtime primitive data type.
This class is a thin wrapper of DLDataType. We also make use of MXNetDataType in compiler to store quick hint
◆ TypeCode
Type code for the MXNetDataType.
Enumerator |
---|
kInt | |
kUInt | |
kFloat | |
kHandle | |
◆ MXNetDataType() [1/3]
mxnet::runtime::MXNetDataType::MXNetDataType |
( |
| ) |
|
|
inline |
◆ MXNetDataType() [2/3]
mxnet::runtime::MXNetDataType::MXNetDataType |
( |
DLDataType |
dtype | ) |
|
|
inlineexplicit |
◆ MXNetDataType() [3/3]
mxnet::runtime::MXNetDataType::MXNetDataType |
( |
int |
code, |
|
|
int |
bits, |
|
|
int |
lanes |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
code | The type code. |
bits | The number of bits in the type. |
lanes | The number of lanes. |
◆ bits()
int mxnet::runtime::MXNetDataType::bits |
( |
| ) |
const |
|
inline |
- Returns
- number of bits in the data.
◆ Bool()
static MXNetDataType mxnet::runtime::MXNetDataType::Bool |
( |
int |
lanes = 1 | ) |
|
|
inlinestatic |
Construct a bool type.
- Parameters
-
- Returns
- The constructed data type.
◆ bytes()
int mxnet::runtime::MXNetDataType::bytes |
( |
| ) |
const |
|
inline |
- Returns
- number of bytes to store each scalar.
◆ code()
int mxnet::runtime::MXNetDataType::code |
( |
| ) |
const |
|
inline |
◆ element_of()
MXNetDataType mxnet::runtime::MXNetDataType::element_of |
( |
| ) |
const |
|
inline |
Get the scalar version of the type.
- Returns
- the result type.
◆ Float()
static MXNetDataType mxnet::runtime::MXNetDataType::Float |
( |
int |
bits, |
|
|
int |
lanes = 1 |
|
) |
| |
|
inlinestatic |
Construct an uint type.
- Parameters
-
bits | The number of bits in the type. |
lanes | The number of lanes |
- Returns
- The constructed data type.
◆ Handle()
static MXNetDataType mxnet::runtime::MXNetDataType::Handle |
( |
int |
bits = 64 , |
|
|
int |
lanes = 1 |
|
) |
| |
|
inlinestatic |
Construct a handle type.
- Parameters
-
bits | The number of bits in the type. |
lanes | The number of lanes |
- Returns
- The constructed data type.
◆ Int()
static MXNetDataType mxnet::runtime::MXNetDataType::Int |
( |
int |
bits, |
|
|
int |
lanes = 1 |
|
) |
| |
|
inlinestatic |
Construct an int type.
- Parameters
-
bits | The number of bits in the type. |
lanes | The number of lanes. |
- Returns
- The constructed data type.
◆ is_bool()
bool mxnet::runtime::MXNetDataType::is_bool |
( |
| ) |
const |
|
inline |
- Returns
- whether type is a scalar type.
◆ is_float()
bool mxnet::runtime::MXNetDataType::is_float |
( |
| ) |
const |
|
inline |
- Returns
- whether type is a float type.
◆ is_handle()
bool mxnet::runtime::MXNetDataType::is_handle |
( |
| ) |
const |
|
inline |
- Returns
- whether type is a handle type.
◆ is_int()
bool mxnet::runtime::MXNetDataType::is_int |
( |
| ) |
const |
|
inline |
- Returns
- whether type is an int type.
◆ is_scalar()
bool mxnet::runtime::MXNetDataType::is_scalar |
( |
| ) |
const |
|
inline |
- Returns
- whether type is a scalar type.
◆ is_uint()
bool mxnet::runtime::MXNetDataType::is_uint |
( |
| ) |
const |
|
inline |
- Returns
- whether type is an uint type.
◆ is_vector()
bool mxnet::runtime::MXNetDataType::is_vector |
( |
| ) |
const |
|
inline |
- Returns
- whether type is a vector type.
◆ lanes()
int mxnet::runtime::MXNetDataType::lanes |
( |
| ) |
const |
|
inline |
- Returns
- number of lanes in the data.
◆ operator DLDataType()
mxnet::runtime::MXNetDataType::operator DLDataType |
( |
| ) |
const |
|
inline |
◆ operator!=()
bool mxnet::runtime::MXNetDataType::operator!= |
( |
const MXNetDataType & |
other | ) |
const |
|
inline |
NotEqual comparator.
- Parameters
-
other | The data type to compre against. |
- Returns
- The comparison resilt.
◆ operator==()
bool mxnet::runtime::MXNetDataType::operator== |
( |
const MXNetDataType & |
other | ) |
const |
|
inline |
Equal comparator.
- Parameters
-
other | The data type to compre against. |
- Returns
- The comparison resilt.
◆ UInt()
static MXNetDataType mxnet::runtime::MXNetDataType::UInt |
( |
int |
bits, |
|
|
int |
lanes = 1 |
|
) |
| |
|
inlinestatic |
Construct an uint type.
- Parameters
-
bits | The number of bits in the type. |
lanes | The number of lanes |
- Returns
- The constructed data type.
◆ with_bits()
MXNetDataType mxnet::runtime::MXNetDataType::with_bits |
( |
int |
bits | ) |
const |
|
inline |
Create a new data type by change bits to a specified value.
- Parameters
-
bits | The target number of bits. |
- Returns
- the result type.
◆ with_lanes()
MXNetDataType mxnet::runtime::MXNetDataType::with_lanes |
( |
int |
lanes | ) |
const |
|
inline |
Create a new data type by change lanes to a specified value.
- Parameters
-
lanes | The target number of lanes. |
- Returns
- the result type.
The documentation for this class was generated from the following file: