14 static_assert(
sizeof(
float ) == 4,
"Unsupported platform: float must be 4 bytes." );
15 static_assert(
sizeof(
double ) == 8,
"Unsupported platform: double must be 8 bytes." );
16 static_assert(
sizeof(
int ) == 4,
"Unsupported platform: int must be 4 bytes." );
17 static_assert(
sizeof(int8_t ) == 1,
"Unsupported platform: int8_t must be 1 byte." );
18 static_assert(
sizeof(int16_t ) == 2,
"Unsupported platform: int16_t must be 2 bytes." );
19 static_assert(
sizeof(int32_t ) == 4,
"Unsupported platform: int32_t must be 4 bytes." );
20 static_assert(
sizeof(int64_t ) == 8,
"Unsupported platform: int64_t must be 8 bytes." );
21 static_assert(
sizeof(uint8_t ) == 1,
"Unsupported platform: uint8_t must be 1 byte." );
22 static_assert(
sizeof(uint16_t) == 2,
"Unsupported platform: uint16_t must be 2 bytes.");
23 static_assert(
sizeof(uint32_t) == 4,
"Unsupported platform: uint32_t must be 4 bytes.");
24 static_assert(
sizeof(uint64_t) == 8,
"Unsupported platform: uint64_t must be 8 bytes.");
25 static_assert(
sizeof(
bool ) == 1,
"Unsupported platform: bool must be 1 byte." );
55 : dtype_code_(dtype_code), byte_size_(byte_size) {
56 if (
name.size() > max_name_len_ - 1) {
59 std::strncpy(name_,
name.c_str(), max_name_len_);
60 name_[max_name_len_ - 1] =
'\0';
65 return dtype_code_ == other.dtype_code_ && byte_size_ == other.byte_size_ &&
66 std::strcmp(name_, other.name_) == 0;
static const Dtype Undefined
static const Dtype Float32
bool operator==(const Dtype &other) const
static const Dtype UInt16
bool operator!=(const Dtype &other) const
static const Dtype UInt64
static const Dtype UInt32
static const Dtype Float64
Generic file read and write utility for python interface.