MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / XLATypeToCpp

Function XLATypeToCpp

tensorflow/compiler/aot/codegen.cc:51–91  ·  view source on GitHub ↗

Convert an XLA type into a C++ type.

Source from the content-addressed store, hash-verified

49
50// Convert an XLA type into a C++ type.
51Status XLATypeToCpp(xla::PrimitiveType type, string* str) {
52 switch (type) {
53 case xla::PRED:
54 *str = "bool";
55 break;
56 case xla::S8:
57 *str = "tensorflow::int8";
58 break;
59 case xla::S16:
60 *str = "tensorflow::int16";
61 break;
62 case xla::S32:
63 *str = "tensorflow::int32";
64 break;
65 case xla::S64:
66 *str = "tensorflow::int64";
67 break;
68 case xla::U8:
69 *str = "tensorflow::uint8";
70 break;
71 case xla::U16:
72 *str = "tensorflow::uint16";
73 break;
74 case xla::U32:
75 *str = "tensorflow::uint32";
76 break;
77 case xla::U64:
78 *str = "tensorflow::uint64";
79 break;
80 case xla::F32:
81 *str = "float";
82 break;
83 case xla::F64:
84 *str = "double";
85 break;
86 default:
87 return errors::Unimplemented("XLA type ", xla::PrimitiveType_Name(type),
88 " has no equivalent in C++");
89 }
90 return Status::OK();
91}
92
93// Returns the sum of the size of each buffer in `buffer_infos`.
94size_t TotalBufferBytes(const std::vector<BufferInfo>& buffer_infos) {

Callers 1

AddRewritesForShapeFunction · 0.85

Calls 1

UnimplementedFunction · 0.85

Tested by

no test coverage detected