| 190 | |
| 191 | template <typename Visitor> |
| 192 | inline void VisitIntDataType(proto::VarType::Type type, Visitor visitor) { |
| 193 | #define VisitIntDataTypeCallback(cpp_type, proto_type) \ |
| 194 | do { \ |
| 195 | if (type == proto_type) { \ |
| 196 | visitor.template apply<cpp_type>(); \ |
| 197 | return; \ |
| 198 | } \ |
| 199 | } while (0) |
| 200 | |
| 201 | _ForEachIntDataType_(VisitIntDataTypeCallback); |
| 202 | |
| 203 | PADDLE_THROW(common::errors::Unimplemented( |
| 204 | "Expected integral data type, but got %s", DataTypeToString(type))); |
| 205 | |
| 206 | #undef VisitIntDataTypeCallback |
| 207 | } |
| 208 | |
| 209 | template <typename Visitor> |
| 210 | inline void VisitDataTypeTiny(proto::VarType::Type type, Visitor visitor) { |
nothing calls this directly
no test coverage detected