48 explicit Dtype(DtypeCode dtype_code,
50 const std::string &
name);
59 int64_t
ByteSize()
const {
return byte_size_; }
63 bool IsObject()
const {
return dtype_code_ == DtypeCode::Object; }
72 static constexpr
size_t max_name_len_ = 16;
73 DtypeCode dtype_code_;
75 char name_[max_name_len_];
92 inline const Dtype Dtype::FromType<float>() {
97 inline const Dtype Dtype::FromType<double>() {
102 inline const Dtype Dtype::FromType<int8_t>() {
107 inline const Dtype Dtype::FromType<int16_t>() {
112 inline const Dtype Dtype::FromType<int32_t>() {
117 inline const Dtype Dtype::FromType<int64_t>() {
122 inline const Dtype Dtype::FromType<uint8_t>() {
127 inline const Dtype Dtype::FromType<uint16_t>() {
132 inline const Dtype Dtype::FromType<uint32_t>() {
137 inline const Dtype Dtype::FromType<uint64_t>() {
142 inline const Dtype Dtype::FromType<bool>() {
std::string ToString() const
static const Dtype Undefined
static const Dtype Float32
static const Dtype UInt16
static const Dtype FromType()
static const Dtype UInt64
static const Dtype UInt32
static const Dtype Float64
DtypeCode GetDtypeCode() const
constexpr bool operator!=(const optional< T > &x, const optional< T > &y)
constexpr bool operator==(const optional< T > &x, const optional< T > &y)
Generic file read and write utility for python interface.