-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathcommon.h
39 lines (33 loc) · 1.01 KB
/
common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef COMMON_TYPES
#define COMMON_TYPES
#include "common/bf16_t.h"
#include "common/data_type.h"
#include "common/error_handler.h"
#include "common/fp16_t.h"
#include "common/range.h"
#include "common/rc.hpp"
#include "common/slice.h"
#include <absl/container/inlined_vector.h>
#include <memory>
#include <sstream>
namespace refactor {
/// @brief 用于表示维度/形状的差的数值,主要是一些属性。
using ddim_t = int16_t;
/// @brief 用于表示形状的数值。
using dim_t = uint32_t;
/// @brief 用于表示带符号的形状的数值。
using sdim_t = int32_t;
/// @brief 用于表示对象的数量。
using count_t = uint32_t;
template<class T> using Arc = std::shared_ptr<T>;
template<class Container> std::string vec2str(Container const &vec) {
std::stringstream ss;
ss << "[ ";
for (auto d : vec) {
ss << d << ' ';
}
ss << ']';
return ss.str();
}
}// namespace refactor
#endif// COMMON_TYPES