Greetings fellow learners, it is requested to clarify what do the highlighted terms mean:
Also why did we do the red circled things twice?
Hello @Talha1234! Thanks for the question!
time.time()
gives the current time. So tic
and toc
record the time before and after executing the code of c = np.dot(a, b)
, and then you can do toc - tic
to get the time that you have spent for executing the code.
It is ran twice but the first is for c=np.dot (...)
and the second is for c = my_dot(...)
, so you can compare the time that you have spent for each of the code lines and see which one is faster.