Understanding the L class fastai

Hello,

I was currently going through the fastai book (very fruitful read) and came across the following syntax:

plt.plot(L(learn.recorder.values).itemgot(2));

Digging deeper I found that the L was a specific class to the fastai library. I experimented with the function a bit and saw the following changes.

I was confused as to how the structure changed in such a way. What does the L class do to the list and what do the hashtag numeric values signify?

I’d recommend it’s documentation in the fastcore docs here: https://fastcore.fast.ai/#L

Jeremy calls it a superpowered list :slight_smile:

3 Likes