What is k in kFloat, kInt, kUint?

What does the k prefix stands for in many libtorch types ?

It’s pure speculation, but my take is that it could be “konstant” in Hungarian Notation.
I think these came with ATen, but @zdevito would know know a lot more than me.

Best regards


I have a sort of n00b question related to this: at::kLong, at::kFloat etc don’t appear to be defined anywhere in the pytorch codebase.

I’m guessing this is because they get defined according to your system somehow at build time, but I’d love a pointer to where this definition is created, and what I need to do to see this definition for my system.

Answering my own question: these constants are defined via a macro here: pytorch/ScalarType.h at 71f9e99e293d0eff8da665b69543d044a6a4454d · pytorch/pytorch · GitHub