What is k in kFloat, kInt, kUint?

What does the k prefix stands for in many libtorch types ?
https://pytorch.org/cppdocs/api/file_torch_csrc_api_include_torch_types.h.html#file-torch-csrc-api-include-torch-types-h

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

Thomas

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

1 Like

I’ve been confused by kInt all the day, thank you very much! :smiling_face_with_three_hearts: