Meaning of cls in variable/method names

I see “cls” in a lot of names. What is it short for, or an acronym for?

1 Like

It’s an abbreviation for class.

1 Like

For those coming from Google (like me): there’s no need to specify anything for cls. For example, checking the helper of ImageDataLoaders.from_folder we have:

Signature: ImageDataLoaders.from_folder(cls, path, train='train', valid='valid', valid_pct=None, seed=None, vocab=None, item_tfms=None, batch_tfms=None, bs=64, val_bs=None, shuffle_train=True, device=None)

The only mandatory argument there is actually path, so you can use it as ImageDataLoaders.from_folder(path=’/root/my/path/’).

1 Like