blob: fa839ba5b3cbbc2c4ce4a57dc22010c4cd29e14f [file] [log] [blame]
// TODO: I'm pretty sure Constness can be done with C++ templates, ala
// std::is_const, but no time to work it out...
#define GENERIC_IF(Constness, FullKind, x, Kind) \
auto && __match_key = x; \
switch(__match_key->kind()) { \
case FullKind: { \
auto * value = static_cast<Constness ::torch::jit::Kind*>(__match_key); (void) value;
#define GENERIC_ELSEIF(Constness, FullKind, Kind) \
} break; \
case FullKind: { \
auto * value = static_cast<Constness ::torch::jit::Kind*>(__match_key); (void) value;
#define GENERIC_ELSE() \
} break; \
default: {
#define GENERIC_END() \
} break; \
};