#@save definition and importance python

Viewed 1500

I have seen this #@save in multiple instances in python most often in Jupyter and Colab notebooks. Please explain the usage of this operator, the importance, and how to use it. An example is shown below.

#@save
import collections
from collections import defaultdict
from IPython import display
2 Answers

If there is a #@save before a function, it means this has been stored in the d2l.

for example, you don't need to define a function(which existed on the book) again if you import the d2l:

from d2l import torch as d2l
d2l.use_svg_display()

See it? there is no error, but remember use the "d2l." before use the function.

Related