3
#define AT_FORALL_SCALAR_TYPES_WITH_COMPLEX_AND_QINTS(_) \
  _(uint8_t, Byte) /* 0 */                               \
  _(int8_t, Char) /* 1 */                                \
  _(int16_t, Short) /* 2 */                              \
  _(int, Int) /* 3 */                                    \
  _(int64_t, Long) /* 4 */                               \
  _(at::Half, Half) /* 5 */                              \
  _(float, Float) /* 6 */                                \
  _(double, Double) /* 7 */                              \
  _(c10::complex<c10::Half>, ComplexHalf) /* 8 */        \
  _(c10::complex<float>, ComplexFloat) /* 9 */           \
  _(c10::complex<double>, ComplexDouble) /* 10 */        \
  _(bool, Bool) /* 11 */                                 \
  _(c10::qint8, QInt8) /* 12 */                          \
  _(c10::quint8, QUInt8) /* 13 */                        \
  _(c10::qint32, QInt32) /* 14 */                        \
  _(at::BFloat16, BFloat16) /* 15 */

Typically, #define AT_FORALL_SCALAR_TYPES_WITH_COMPLEX_AND_QINTS(_) has an underline between the parenthesis.

And _(uint8_t, Byte) has underline outside the parenthesis. I have googled a lot but my english is not good enough to get the answer.

Bob liao
  • 569
  • 4
  • 15
  • 5
    `_` is the macro's argument - it's a valid identifier. You can replace with something more readable if you want to. – molbdnilo Aug 31 '20 at 11:03
  • 3
    This pattern is called the "X macro", except using an underscore instead of X. See this question: [Real-world use of X-Macros](https://stackoverflow.com/questions/6635851/real-world-use-of-x-macros) – Botje Aug 31 '20 at 11:06

0 Answers0