| 144 | |
| 145 | template <typename Visitor> |
| 146 | inline void VisitDataType(proto::VarType::Type type, Visitor visitor) { |
| 147 | #define VisitDataTypeCallback(cpp_type, proto_type) \ |
| 148 | do { \ |
| 149 | if (type == proto_type) { \ |
| 150 | visitor.template apply<cpp_type>(); \ |
| 151 | return; \ |
| 152 | } \ |
| 153 | } while (0) |
| 154 | |
| 155 | _ForEachDataType_(VisitDataTypeCallback); |
| 156 | #undef VisitDataTypeCallback |
| 157 | PADDLE_THROW(common::errors::Unimplemented( |
| 158 | "Not supported proto::VarType::Type(%d) as data type.", |
| 159 | static_cast<int>(type))); |
| 160 | } |
| 161 | |
| 162 | template <typename Visitor> |
| 163 | inline void VisitDataTypeSmall(proto::VarType::Type type, Visitor visitor) { |
no outgoing calls
no test coverage detected