| 79 | } |
| 80 | |
| 81 | std::string DataTypeToString(const proto::VarType::Type type) { |
| 82 | auto it = gDataTypeMap().proto_to_str_.find(static_cast<int>(type)); |
| 83 | if (it != gDataTypeMap().proto_to_str_.end()) { |
| 84 | return it->second; |
| 85 | } |
| 86 | // deal with RAW type |
| 87 | if (type == proto::VarType::RAW) { |
| 88 | return "RAW(runtime decided type)"; |
| 89 | } |
| 90 | PADDLE_THROW(common::errors::Unimplemented( |
| 91 | "Not support proto::VarType::Type(%d) as tensor type.", |
| 92 | static_cast<int>(type))); |
| 93 | } |
| 94 | |
| 95 | size_t SizeOfType(proto::VarType::Type type) { |
| 96 | auto it = gDataTypeMap().proto_to_size_.find(static_cast<int>(type)); |
no test coverage detected